Spaces:
Runtime error
Runtime error
Commit
·
fdebc5f
1
Parent(s):
81c7ed1
Update app.py
Browse files
app.py
CHANGED
|
@@ -73,26 +73,6 @@ def load_data():
|
|
| 73 |
reviews, total_reviews = get_latest_reviews(db)
|
| 74 |
db.close()
|
| 75 |
return reviews, total_reviews
|
| 76 |
-
def run_actr():
|
| 77 |
-
from python_actr import log_everything
|
| 78 |
-
|
| 79 |
-
#code1="tim = MyAgent()"
|
| 80 |
-
#code2="subway=MyEnv()"
|
| 81 |
-
#code3="subway.agent=tim"
|
| 82 |
-
#code4="log_everything(subway)"]
|
| 83 |
-
from dcogsphere import RockPaperScissors
|
| 84 |
-
from dcogsphere import ProceduralPlayer
|
| 85 |
-
from dcogsphere import logy
|
| 86 |
-
|
| 87 |
-
env=RockPaperScissors()
|
| 88 |
-
env.model1=ProceduralPlayer()
|
| 89 |
-
env.model1.choice=env.choice1
|
| 90 |
-
env.model2=ProceduralPlayer()
|
| 91 |
-
env.model2.choice=env.choice2
|
| 92 |
-
response=env.run()
|
| 93 |
-
#print (response)
|
| 94 |
-
resu=logy()
|
| 95 |
-
return resu
|
| 96 |
|
| 97 |
css="footer {visibility: hidden}"
|
| 98 |
|
|
@@ -109,19 +89,11 @@ with gr.Blocks(css=css) as demo:
|
|
| 109 |
rate = gr.Textbox(label="b") #, placeholder="What is your name?") #gr.Radio(label="How satisfied are you with using gradio?", choices=[1, 2, 3, 4, 5])
|
| 110 |
celsci = gr.Textbox(label="c") #, lines=10, placeholder="Do you have any feedback on gradio?")
|
| 111 |
submit = gr.Button(value=".")
|
| 112 |
-
#submit2 = gr.Button(value="Run Code")
|
| 113 |
-
name=run_actr()
|
| 114 |
-
#submit.click(run_actr)
|
| 115 |
-
#if (celsci=="Celscis List"):
|
| 116 |
-
# submit.click(ccogsphere, [name, rate, celsci], [data, count])
|
| 117 |
-
#else:
|
| 118 |
-
# submit.click(ccogsphere, [name, rate, celsci], [data, count])
|
| 119 |
-
#name=logy()
|
| 120 |
submit.click(ccogsphere, [name, rate, celsci], [data, count])
|
| 121 |
demo.load(load_data, None, [data, count])
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
|
| 126 |
def secwork(name):
|
| 127 |
#if name=="abc":
|
|
|
|
| 73 |
reviews, total_reviews = get_latest_reviews(db)
|
| 74 |
db.close()
|
| 75 |
return reviews, total_reviews
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 76 |
|
| 77 |
css="footer {visibility: hidden}"
|
| 78 |
|
|
|
|
| 89 |
rate = gr.Textbox(label="b") #, placeholder="What is your name?") #gr.Radio(label="How satisfied are you with using gradio?", choices=[1, 2, 3, 4, 5])
|
| 90 |
celsci = gr.Textbox(label="c") #, lines=10, placeholder="Do you have any feedback on gradio?")
|
| 91 |
submit = gr.Button(value=".")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 92 |
submit.click(ccogsphere, [name, rate, celsci], [data, count])
|
| 93 |
demo.load(load_data, None, [data, count])
|
| 94 |
+
@name.change(inputs=name, outputs=celsci,_js="window.location.reload()")
|
| 95 |
+
@rate.change(inputs=rate, outputs=name,_js="window.location.reload()")
|
| 96 |
+
@celsci.change(inputs=celsci, outputs=rate,_js="window.location.reload()")
|
| 97 |
|
| 98 |
def secwork(name):
|
| 99 |
#if name=="abc":
|