Update app.py
Browse files
app.py
CHANGED
@@ -158,9 +158,16 @@ def run_inference_and_analysis(task, system_prompt, input_text, temperature, top
|
|
158 |
# Gradio interface
|
159 |
def gradio_interface():
|
160 |
with gr.Blocks(theme=gr.themes.Base(), title="Prompt Engineering and LLM Studio") as demo:
|
161 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
162 |
"""
|
163 |
-
<img src="https://raw.githubusercontent.com/pixeltable/pixeltable/main/docs/source/data/pixeltable-logo-large.png" alt="Pixeltable" width="20%" /></img>
|
164 |
# Prompt Engineering and LLM Studio
|
165 |
|
166 |
This application demonstrates how [Pixeltable](https://github.com/pixeltable/pixeltable) can be used for rapid and incremental prompt engineering
|
@@ -216,7 +223,7 @@ def gradio_interface():
|
|
216 |
submit_btn = gr.Button("Run Inference and Analysis")
|
217 |
|
218 |
with gr.Tabs():
|
219 |
-
with gr.Tab("Prompt
|
220 |
history = gr.Dataframe(
|
221 |
headers=["Task", "System Prompt", "Input Text", "Timestamp"],
|
222 |
wrap=True
|
@@ -265,22 +272,7 @@ def gradio_interface():
|
|
265 |
"The new restaurant downtown exceeded all my expectations. The food was exquisite, the service impeccable, and the ambiance was perfect for a romantic evening. I can't wait to go back!",
|
266 |
0.3, 0.95, 200, None, "", None, False],
|
267 |
|
268 |
-
# Example 2:
|
269 |
-
["Code Explanation",
|
270 |
-
"You are an expert programmer. Explain the given code snippet in simple terms, highlighting its purpose, key components, and potential improvements.",
|
271 |
-
"""
|
272 |
-
def quicksort(arr):
|
273 |
-
if len(arr) <= 1:
|
274 |
-
return arr
|
275 |
-
pivot = arr[len(arr) // 2]
|
276 |
-
left = [x for x in arr if x < pivot]
|
277 |
-
middle = [x for x in arr if x == pivot]
|
278 |
-
right = [x for x in arr if x > pivot]
|
279 |
-
return quicksort(left) + middle + quicksort(right)
|
280 |
-
""",
|
281 |
-
0.7, 0.9, 400, 100, "In conclusion,", 42, True],
|
282 |
-
|
283 |
-
# Example 3: Creative Writing
|
284 |
["Story Generation",
|
285 |
"You are a creative writer. Generate a short, engaging story based on the given prompt. Include vivid descriptions and an unexpected twist.",
|
286 |
"In a world where dreams are shared, a young girl discovers she can manipulate other people's dreams.",
|
|
|
158 |
# Gradio interface
|
159 |
def gradio_interface():
|
160 |
with gr.Blocks(theme=gr.themes.Base(), title="Prompt Engineering and LLM Studio") as demo:
|
161 |
+
gr.Markdown(
|
162 |
+
"""
|
163 |
+
<div style= margin-bottom: 20px;">
|
164 |
+
<img src="https://raw.githubusercontent.com/pixeltable/pixeltable/main/docs/source/data/pixeltable-logo-large.png" alt="Pixeltable" style="max-width: 150px;" />
|
165 |
+
<h2>Text and Image similarity search on video frames with embedding indexes</h2>
|
166 |
+
</div>
|
167 |
+
"""
|
168 |
+
)
|
169 |
+
gr.Markdown(
|
170 |
"""
|
|
|
171 |
# Prompt Engineering and LLM Studio
|
172 |
|
173 |
This application demonstrates how [Pixeltable](https://github.com/pixeltable/pixeltable) can be used for rapid and incremental prompt engineering
|
|
|
223 |
submit_btn = gr.Button("Run Inference and Analysis")
|
224 |
|
225 |
with gr.Tabs():
|
226 |
+
with gr.Tab("Prompt Input"):
|
227 |
history = gr.Dataframe(
|
228 |
headers=["Task", "System Prompt", "Input Text", "Timestamp"],
|
229 |
wrap=True
|
|
|
272 |
"The new restaurant downtown exceeded all my expectations. The food was exquisite, the service impeccable, and the ambiance was perfect for a romantic evening. I can't wait to go back!",
|
273 |
0.3, 0.95, 200, None, "", None, False],
|
274 |
|
275 |
+
# Example 2: Creative Writing
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
276 |
["Story Generation",
|
277 |
"You are a creative writer. Generate a short, engaging story based on the given prompt. Include vivid descriptions and an unexpected twist.",
|
278 |
"In a world where dreams are shared, a young girl discovers she can manipulate other people's dreams.",
|