Spaces:
Runtime error
Runtime error
Commit
·
771b523
1
Parent(s):
efebb1d
Update app.py
Browse files
app.py
CHANGED
|
@@ -114,35 +114,25 @@ def respond3(message, chat_history):
|
|
| 114 |
with gr.Blocks() as demo:
|
| 115 |
with gr.Row():
|
| 116 |
with gr.Column():
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
#csinp.submit(cs, [csinp, cschatbot], [csinp, cschatbot])
|
| 137 |
-
|
| 138 |
-
def cs(link):
|
| 139 |
-
response="Hi " + link #(link) #acf("hello world")[0]["label"] + str(math.trunc(acf("hello world")[0]["score"])*100/100)+bcf(link)
|
| 140 |
-
return response,1 #result #soup.prettify()
|
| 141 |
-
cssubmit.click(cs, name, [comments,count])
|
| 142 |
-
interface = gr.Interface(cs, gr.Textbox(), gr.Textbox())
|
| 143 |
-
interface.launch(inline=True)
|
| 144 |
-
#gr.Markdown("Based on dataset [here](https://huggingface.co/datasets/freddyaboulton/gradio-reviews)")
|
| 145 |
-
|
| 146 |
|
| 147 |
with gr.Row():
|
| 148 |
with gr.Column():
|
|
@@ -179,22 +169,22 @@ with gr.Blocks() as demo:
|
|
| 179 |
print("updating db")
|
| 180 |
repo.push_to_hub(blocking=False, commit_message=f"Updating data at {datetime.datetime.now()}")
|
| 181 |
submit.click(backup_db2)
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
|
| 187 |
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
|
| 196 |
|
| 197 |
-
|
| 198 |
|
| 199 |
#cssubmit.click(add_review, [name, review, comments], [data, count])
|
| 200 |
|
|
|
|
| 114 |
with gr.Blocks() as demo:
|
| 115 |
with gr.Row():
|
| 116 |
with gr.Column():
|
| 117 |
+
with gr.Box():
|
| 118 |
+
gr.Markdown("Based on dataset [here](https://huggingface.co/datasets/freddyaboulton/gradio-reviews)")
|
| 119 |
+
#data = gr.Dataframe()
|
| 120 |
+
count = gr.Number(label="Total number of reviews")
|
| 121 |
+
name = gr.Textbox(label="Name", placeholder="ur name?")
|
| 122 |
+
review = gr.Radio(label="How satisfied are you with your pick?", choices=[1, 2, 3, 4, 5, 6])
|
| 123 |
+
comments = gr.Textbox(label="Comments0", lines=10, placeholder="comm?")
|
| 124 |
+
cssubmit = gr.Button(value="Submit Choice")
|
| 125 |
+
#cschatbot = gr.Chatbot()
|
| 126 |
+
#csinp = gr.Textbox()
|
| 127 |
+
#csout=cs(csinp)
|
| 128 |
+
#csclear = gr.ClearButton([csinp, cschatbot])
|
| 129 |
+
|
| 130 |
+
#csinp.submit(cs, [csinp, cschatbot], [csinp, cschatbot])
|
| 131 |
+
|
| 132 |
+
def cs(link):
|
| 133 |
+
response="Hi " + link #(link) #acf("hello world")[0]["label"] + str(math.trunc(acf("hello world")[0]["score"])*100/100)+bcf(link)
|
| 134 |
+
return response,1 #result #soup.prettify()
|
| 135 |
+
cssubmit.click(cs, name, [comments,count])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 136 |
|
| 137 |
with gr.Row():
|
| 138 |
with gr.Column():
|
|
|
|
| 169 |
print("updating db")
|
| 170 |
repo.push_to_hub(blocking=False, commit_message=f"Updating data at {datetime.datetime.now()}")
|
| 171 |
submit.click(backup_db2)
|
| 172 |
+
with gr.Column():
|
| 173 |
+
with gr.Box():
|
| 174 |
+
gr.Code(
|
| 175 |
+
value="""def hello_world():
|
| 176 |
+
return "Hello, world!"
|
| 177 |
|
| 178 |
+
print(hello_world())""",
|
| 179 |
+
language="python",
|
| 180 |
+
interactive=True,
|
| 181 |
+
show_label=False,
|
| 182 |
+
)
|
| 183 |
+
gr.Markdown("Based on dataset [here](https://huggingface.co/datasets/freddyaboulton/gradio-reviews)")
|
| 184 |
+
data = gr.Dataframe()
|
| 185 |
+
count = gr.Number(label="Total number of reviews")
|
| 186 |
|
| 187 |
+
submit.click(add_review, [name, review, comments], [data, count])
|
| 188 |
|
| 189 |
#cssubmit.click(add_review, [name, review, comments], [data, count])
|
| 190 |
|