Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -27,7 +27,7 @@ try:
|
|
| 27 |
except:
|
| 28 |
print("file not found")
|
| 29 |
|
| 30 |
-
def AIMemory(name: str, message: str
|
| 31 |
if name and message:
|
| 32 |
with open(DATA_FILE, "a") as csvfile:
|
| 33 |
writer = csv.DictWriter(csvfile, fieldnames=["name", "message", "time"])
|
|
@@ -47,7 +47,7 @@ generator1 = gr.Interface.load("huggingface/gpt2-large", api_key=HF_TOKEN)
|
|
| 47 |
generator2 = gr.Interface.load("huggingface/EleutherAI/gpt-neo-2.7B", api_key=HF_TOKEN)
|
| 48 |
generator3 = gr.Interface.load("huggingface/EleutherAI/gpt-j-6B", api_key=HF_TOKEN)
|
| 49 |
|
| 50 |
-
def calculator(text1, operation, text2):
|
| 51 |
if operation == "add":
|
| 52 |
output = generator1(text1) + generator2(text2)
|
| 53 |
saved = AIMemory(text1 + " " + text2, output)
|
|
|
|
| 27 |
except:
|
| 28 |
print("file not found")
|
| 29 |
|
| 30 |
+
def AIMemory(name: str, message: str):
|
| 31 |
if name and message:
|
| 32 |
with open(DATA_FILE, "a") as csvfile:
|
| 33 |
writer = csv.DictWriter(csvfile, fieldnames=["name", "message", "time"])
|
|
|
|
| 47 |
generator2 = gr.Interface.load("huggingface/EleutherAI/gpt-neo-2.7B", api_key=HF_TOKEN)
|
| 48 |
generator3 = gr.Interface.load("huggingface/EleutherAI/gpt-j-6B", api_key=HF_TOKEN)
|
| 49 |
|
| 50 |
+
def calculator(text1, operation, text2, context):
|
| 51 |
if operation == "add":
|
| 52 |
output = generator1(text1) + generator2(text2)
|
| 53 |
saved = AIMemory(text1 + " " + text2, output)
|