Tonic commited on
Commit
6e1661f
1 Parent(s): cd0aa02

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
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 = {f"Example {i+1}": example for i, example in enumerate(examples)}
44
 
45
- def load_example(choice_index):
46
- example = examples[choice_index]
 
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():