groshanr commited on
Commit
b399ae3
1 Parent(s): f46bccc

Upload folder using huggingface_hub

Browse files
Files changed (2) hide show
  1. __pycache__/keyfiledict.cpython-312.pyc +0 -0
  2. app.py +2 -13
__pycache__/keyfiledict.cpython-312.pyc ADDED
Binary file (1.88 kB). View file
 
app.py CHANGED
@@ -49,15 +49,6 @@ def updateScore(radio):
49
  else:
50
  score -= 1
51
 
52
- def dialogueBox(radio):
53
- global text
54
- if radio == answer:
55
- text = gr.Textbox("Correct.")
56
- else:
57
- text = gr.Textbox("Incorrect.")
58
-
59
-
60
-
61
  ## gradio
62
  # submit button function. updates everything.
63
  def onSubmit(image, radio, scorebox):
@@ -68,13 +59,10 @@ def onSubmit(image, radio, scorebox):
68
  updateScore(radio)
69
  setRandAnswer()
70
  setMinPairGroup()
71
- dialogueBox(radio)
72
 
73
  image = gr.Image(f'./assets/{answer}.jpeg', label=answer, show_label= False)
74
  radio = gr.Radio(choices=minPairGroup, label='Which word is pictured?', value=None)
75
  scorebox = gr.Markdown(f"# Score: {score}")
76
-
77
-
78
  return image, radio, scorebox
79
 
80
  # the interface
@@ -82,12 +70,13 @@ with gr.Blocks() as demo:
82
  setRandAnswer()
83
  setMinPairGroup()
84
 
 
85
  with gr.Column():
86
  scorebox = gr.Markdown(f"# Score: {score}")
87
  image = gr.Image(f'./assets/{answer}.jpeg', label=answer, show_label= False)
88
  radio = gr.Radio(choices=minPairGroup, label='Which word is pictured?')
89
  submitButton = gr.Button("Submit")
90
  submitButton.click(onSubmit, inputs= [image, radio, scorebox], outputs=[image, radio, scorebox])
91
-
92
 
93
  demo.launch()
 
49
  else:
50
  score -= 1
51
 
 
 
 
 
 
 
 
 
 
52
  ## gradio
53
  # submit button function. updates everything.
54
  def onSubmit(image, radio, scorebox):
 
59
  updateScore(radio)
60
  setRandAnswer()
61
  setMinPairGroup()
 
62
 
63
  image = gr.Image(f'./assets/{answer}.jpeg', label=answer, show_label= False)
64
  radio = gr.Radio(choices=minPairGroup, label='Which word is pictured?', value=None)
65
  scorebox = gr.Markdown(f"# Score: {score}")
 
 
66
  return image, radio, scorebox
67
 
68
  # the interface
 
70
  setRandAnswer()
71
  setMinPairGroup()
72
 
73
+
74
  with gr.Column():
75
  scorebox = gr.Markdown(f"# Score: {score}")
76
  image = gr.Image(f'./assets/{answer}.jpeg', label=answer, show_label= False)
77
  radio = gr.Radio(choices=minPairGroup, label='Which word is pictured?')
78
  submitButton = gr.Button("Submit")
79
  submitButton.click(onSubmit, inputs= [image, radio, scorebox], outputs=[image, radio, scorebox])
80
+
81
 
82
  demo.launch()