Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -27,13 +27,13 @@ The system prompt will not mention any image provided.
|
|
| 27 |
|
| 28 |
For example, if a user says, "a picture of a man in a black suit and tie riding a black dragon", first do a friendly response, then add the title, system prompt, and example user input.
|
| 29 |
Immediately STOP after the example input. It should be EXACTLY in this format:
|
| 30 |
-
"Sure, I'd be happy to help you build a bot! I'm generating a title, system prompt, and an example input. How do they sound?
|
| 31 |
Title: Dragon Trainer
|
| 32 |
System prompt: As an LLM, your job is to provide guidance and tips on mastering dragons. Use a friendly and informative tone.
|
| 33 |
Example input: How can I train a dragon to breathe fire?"
|
| 34 |
|
| 35 |
Here's another example. If a user types, "In the image, there is a drawing of a man in a red suit sitting at a dining table. He is smoking a cigarette, which adds a touch of sophistication to his appearance.", respond:
|
| 36 |
-
"Sure, I'd be happy to help you build a bot! I'm generating a title, system prompt, and an example input. How do they sound?
|
| 37 |
Title: Gentleman's Companion
|
| 38 |
System prompt: Your a sophisticated old man. As an LLM, your job is to provide recommendations for fine dining, cocktails, and cigar brands based on your preferences. Use a sophisticated and refined tone.
|
| 39 |
Example input: Can you suggest a good cigar brand for a man who enjoys smoking while dining in style?"
|
|
@@ -61,7 +61,7 @@ def infer(image_in):
|
|
| 61 |
|
| 62 |
print(f"SUGGESTED LLM: {cleaned_text}")
|
| 63 |
|
| 64 |
-
return cleaned_text
|
| 65 |
|
| 66 |
title = f"LLM Agent from a Picture",
|
| 67 |
description = f"Get a LLM system prompt from a picture so you can use it in <a href='https://huggingface.co/spaces/abidlabs/GPT-Baker'>GPT-Baker</a>."
|
|
@@ -69,7 +69,7 @@ description = f"Get a LLM system prompt from a picture so you can use it in <a h
|
|
| 69 |
css = """
|
| 70 |
#col-container{
|
| 71 |
margin: 0 auto;
|
| 72 |
-
max-width:
|
| 73 |
text-align: left;
|
| 74 |
}
|
| 75 |
"""
|
|
@@ -89,7 +89,8 @@ with gr.Blocks(css=css) as demo:
|
|
| 89 |
submit_btn = gr.Button("Make LLM system from my pic !")
|
| 90 |
with gr.Column():
|
| 91 |
result = gr.Textbox(
|
| 92 |
-
label ="Suggested System"
|
|
|
|
| 93 |
)
|
| 94 |
|
| 95 |
submit_btn.click(
|
|
|
|
| 27 |
|
| 28 |
For example, if a user says, "a picture of a man in a black suit and tie riding a black dragon", first do a friendly response, then add the title, system prompt, and example user input.
|
| 29 |
Immediately STOP after the example input. It should be EXACTLY in this format:
|
| 30 |
+
"Sure, I'd be happy to help you build a bot! I'm generating a title, system prompt, and an example input. How do they sound?
|
| 31 |
Title: Dragon Trainer
|
| 32 |
System prompt: As an LLM, your job is to provide guidance and tips on mastering dragons. Use a friendly and informative tone.
|
| 33 |
Example input: How can I train a dragon to breathe fire?"
|
| 34 |
|
| 35 |
Here's another example. If a user types, "In the image, there is a drawing of a man in a red suit sitting at a dining table. He is smoking a cigarette, which adds a touch of sophistication to his appearance.", respond:
|
| 36 |
+
"Sure, I'd be happy to help you build a bot! I'm generating a title, system prompt, and an example input. How do they sound?
|
| 37 |
Title: Gentleman's Companion
|
| 38 |
System prompt: Your a sophisticated old man. As an LLM, your job is to provide recommendations for fine dining, cocktails, and cigar brands based on your preferences. Use a sophisticated and refined tone.
|
| 39 |
Example input: Can you suggest a good cigar brand for a man who enjoys smoking while dining in style?"
|
|
|
|
| 61 |
|
| 62 |
print(f"SUGGESTED LLM: {cleaned_text}")
|
| 63 |
|
| 64 |
+
return cleaned_text.lstrip("\n")
|
| 65 |
|
| 66 |
title = f"LLM Agent from a Picture",
|
| 67 |
description = f"Get a LLM system prompt from a picture so you can use it in <a href='https://huggingface.co/spaces/abidlabs/GPT-Baker'>GPT-Baker</a>."
|
|
|
|
| 69 |
css = """
|
| 70 |
#col-container{
|
| 71 |
margin: 0 auto;
|
| 72 |
+
max-width: 780px;
|
| 73 |
text-align: left;
|
| 74 |
}
|
| 75 |
"""
|
|
|
|
| 89 |
submit_btn = gr.Button("Make LLM system from my pic !")
|
| 90 |
with gr.Column():
|
| 91 |
result = gr.Textbox(
|
| 92 |
+
label ="Suggested System",
|
| 93 |
+
max_lines = 30
|
| 94 |
)
|
| 95 |
|
| 96 |
submit_btn.click(
|