awacke1 commited on
Commit
babe8c4
1 Parent(s): d493af9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
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
- return generator1(text1) + generator2(text2)
 
 
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(