awacke1 commited on
Commit
d493af9
1 Parent(s): 9a2f978

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -51,11 +51,14 @@ def calculator(text1, operation, text2):
51
  if operation == "add":
52
  return generator1(text1) + generator2(text2)
53
  elif operation == "subtract":
54
- return replace(generator1(text1), generator2(text2), "")
 
55
  elif operation == "multiply":
56
- return generator1(text1) + generator2(text2) + generator2(text3)
 
57
  elif operation == "divide":
58
- return replace(generator1(text1), generator3(text2), "")
 
59
 
60
  demo = gr.Interface(
61
  calculator,
 
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(
64
  calculator,