Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -40,12 +40,14 @@ examples = [
|
|
| 40 |
{"message": "Tell me a joke.", "max_new_tokens": 650, "temperature": 0.7},
|
| 41 |
{"message": "Explain the concept of machine learning.", "max_new_tokens": 980, "temperature": 0.4}
|
| 42 |
]
|
| 43 |
-
example_choices =
|
| 44 |
|
| 45 |
-
def load_example(
|
| 46 |
-
|
|
|
|
| 47 |
return example["message"], example["max_new_tokens"], example["temperature"]
|
| 48 |
|
|
|
|
| 49 |
with gr.Blocks() as demo:
|
| 50 |
gr.Markdown(title)
|
| 51 |
with gr.Row():
|
|
|
|
| 40 |
{"message": "Tell me a joke.", "max_new_tokens": 650, "temperature": 0.7},
|
| 41 |
{"message": "Explain the concept of machine learning.", "max_new_tokens": 980, "temperature": 0.4}
|
| 42 |
]
|
| 43 |
+
example_choices = [f"Example {i+1}" for i in range(len(examples))]
|
| 44 |
|
| 45 |
+
def load_example(choice):
|
| 46 |
+
index = example_choices.index(choice)
|
| 47 |
+
example = examples[index]
|
| 48 |
return example["message"], example["max_new_tokens"], example["temperature"]
|
| 49 |
|
| 50 |
+
|
| 51 |
with gr.Blocks() as demo:
|
| 52 |
gr.Markdown(title)
|
| 53 |
with gr.Row():
|