Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -49,15 +49,20 @@ generator3 = gr.Interface.load("huggingface/EleutherAI/gpt-j-6B", api_key=HF_TOK
|
|
| 49 |
|
| 50 |
def calculator(text1, operation, text2):
|
| 51 |
if operation == "add":
|
| 52 |
-
|
|
|
|
|
|
|
| 53 |
elif operation == "subtract":
|
| 54 |
output = generator1(text1) + generator2(text2)
|
|
|
|
| 55 |
return output.replace(text1, "").replace(text2, "")
|
| 56 |
elif operation == "multiply":
|
| 57 |
output = generator1(text1) + generator2(text2) + generator3(text1)
|
|
|
|
| 58 |
return output
|
| 59 |
elif operation == "divide":
|
| 60 |
output = generator1(text2) + generator2(text1) + generator3(text2)
|
|
|
|
| 61 |
return output.replace(text1, "").replace(text2, "")
|
| 62 |
|
| 63 |
demo = gr.Interface(
|
|
|
|
| 49 |
|
| 50 |
def calculator(text1, operation, text2):
|
| 51 |
if operation == "add":
|
| 52 |
+
output = generator1(text1) + generator2(text2)
|
| 53 |
+
saved = AIMemory(text1 + " " + text2, output)
|
| 54 |
+
return output
|
| 55 |
elif operation == "subtract":
|
| 56 |
output = generator1(text1) + generator2(text2)
|
| 57 |
+
saved = AIMemory(text1 + " " + text2, output)
|
| 58 |
return output.replace(text1, "").replace(text2, "")
|
| 59 |
elif operation == "multiply":
|
| 60 |
output = generator1(text1) + generator2(text2) + generator3(text1)
|
| 61 |
+
saved = AIMemory(text1 + " " + text2, output)
|
| 62 |
return output
|
| 63 |
elif operation == "divide":
|
| 64 |
output = generator1(text2) + generator2(text1) + generator3(text2)
|
| 65 |
+
saved = AIMemory(text1 + " " + text2, output)
|
| 66 |
return output.replace(text1, "").replace(text2, "")
|
| 67 |
|
| 68 |
demo = gr.Interface(
|