Spaces:
Runtime error
Runtime error
thepolymerguy
commited on
Commit
·
bbaca7f
1
Parent(s):
c1df3e9
Update app.py
Browse files
app.py
CHANGED
@@ -290,16 +290,10 @@ def claim_selector(userin, dropd):
|
|
290 |
|
291 |
def desc_selector(userin, dropd):
|
292 |
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
### Response:"""
|
298 |
-
else:
|
299 |
-
PROMPT = f"""Below is an instruction that describes a task. Write a response that appropriately completes the request.
|
300 |
-
### Instruction:
|
301 |
-
{dropd} for a patent application for the following invention: {userin}
|
302 |
-
### Response:"""
|
303 |
|
304 |
return PROMPT
|
305 |
|
@@ -337,7 +331,7 @@ with gr.Blocks(title='Claimed', theme=theme) as demo:
|
|
337 |
placeholder='Type in your idea here!')
|
338 |
text2 = gr.Textbox(label="Output")
|
339 |
with gr.Row():
|
340 |
-
btn = gr.Button("
|
341 |
btn.click(fn=claim_selector, inputs=[text1, Claimchoices]).then(run_model, inputs=[text1, Claimchoices], outputs=text2)
|
342 |
|
343 |
with gr.Tab("Description Generator"):
|
@@ -351,7 +345,7 @@ with gr.Blocks(title='Claimed', theme=theme) as demo:
|
|
351 |
placeholder='Type in your idea here!')
|
352 |
text2 = gr.Textbox(label="Output")
|
353 |
with gr.Row():
|
354 |
-
btn = gr.Button("
|
355 |
btn.click(fn=desc_selector, inputs=[text1, Descriptionchoices]).then(run_model, inputs=[text1, Descriptionchoices], outputs=text2)
|
356 |
|
357 |
# with gr.Tab("Knowledge Graph"):
|
@@ -417,13 +411,11 @@ with gr.Blocks(title='Claimed', theme=theme) as demo:
|
|
417 |
|
418 |
chatbot = gr.Chatbot([], elem_id="Claimed Assistant").style(height=500)
|
419 |
with gr.Row():
|
420 |
-
with gr.Column(scale=
|
421 |
txt = gr.Textbox(
|
422 |
show_label=False,
|
423 |
placeholder="Enter text and submit",
|
424 |
).style(container=False)
|
425 |
-
with gr.Column(scale=0.15, min_width=0):
|
426 |
-
btn = gr.Button("Submit")
|
427 |
|
428 |
txt.submit(add_text, [chatbot, txt], [chatbot, txt]).then(
|
429 |
generateresponse, chatbot, chatbot)
|
|
|
290 |
|
291 |
def desc_selector(userin, dropd):
|
292 |
|
293 |
+
PROMPT = f"""Below is an instruction that describes a task. Write a response that appropriately completes the request.
|
294 |
+
### Instruction:
|
295 |
+
{dropd} for a patent application for the following invention: {userin}
|
296 |
+
### Response:"""
|
|
|
|
|
|
|
|
|
|
|
|
|
297 |
|
298 |
return PROMPT
|
299 |
|
|
|
331 |
placeholder='Type in your idea here!')
|
332 |
text2 = gr.Textbox(label="Output")
|
333 |
with gr.Row():
|
334 |
+
btn = gr.Button("Submit")
|
335 |
btn.click(fn=claim_selector, inputs=[text1, Claimchoices]).then(run_model, inputs=[text1, Claimchoices], outputs=text2)
|
336 |
|
337 |
with gr.Tab("Description Generator"):
|
|
|
345 |
placeholder='Type in your idea here!')
|
346 |
text2 = gr.Textbox(label="Output")
|
347 |
with gr.Row():
|
348 |
+
btn = gr.Button("Submit")
|
349 |
btn.click(fn=desc_selector, inputs=[text1, Descriptionchoices]).then(run_model, inputs=[text1, Descriptionchoices], outputs=text2)
|
350 |
|
351 |
# with gr.Tab("Knowledge Graph"):
|
|
|
411 |
|
412 |
chatbot = gr.Chatbot([], elem_id="Claimed Assistant").style(height=500)
|
413 |
with gr.Row():
|
414 |
+
with gr.Column(scale=1):
|
415 |
txt = gr.Textbox(
|
416 |
show_label=False,
|
417 |
placeholder="Enter text and submit",
|
418 |
).style(container=False)
|
|
|
|
|
419 |
|
420 |
txt.submit(add_text, [chatbot, txt], [chatbot, txt]).then(
|
421 |
generateresponse, chatbot, chatbot)
|