mecoffey commited on
Commit
5ed5bce
·
1 Parent(s): b3b3cf5

testing live loading for gradio objects

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -63,10 +63,10 @@ def char_description(prompt):
63
  input_file = open('traits.txt', 'r')
64
  traits = input_file.readline()
65
  global pref_traits
66
- picks = random.randint(1,3)
67
  pref_traits = random.choice(traits, k=picks)
68
  global ick_traits
69
- picks = random.randint(1,3)
70
  ick_traits = random.choice(traits, k=picks)
71
  return output1[0]["generated_text"].strip(),output2[0]["generated_text"].strip()
72
 
@@ -133,7 +133,7 @@ with gr.Blocks() as demo:
133
 
134
  with gr.Accordion("Bard Stats", open = False):
135
  with gr.Row():
136
- dcs = gr.Textbox(value = smash, label = "DC to Smash")
137
  prefs = gr.Textbox(value = pref_traits, label = "Advantage if:")
138
  icks = gr.Textbox(value = ick_traits, label = "Disdvantage if:")
139
 
 
63
  input_file = open('traits.txt', 'r')
64
  traits = input_file.readline()
65
  global pref_traits
66
+ picks = int(random.randint(1,3))
67
  pref_traits = random.choice(traits, k=picks)
68
  global ick_traits
69
+ picks = int(random.randint(1,3))
70
  ick_traits = random.choice(traits, k=picks)
71
  return output1[0]["generated_text"].strip(),output2[0]["generated_text"].strip()
72
 
 
133
 
134
  with gr.Accordion("Bard Stats", open = False):
135
  with gr.Row():
136
+ dcs = gr.Textbox(value = smash, label = "DC to Smash", live = True)
137
  prefs = gr.Textbox(value = pref_traits, label = "Advantage if:")
138
  icks = gr.Textbox(value = ick_traits, label = "Disdvantage if:")
139