Spaces:
Runtime error
Runtime error
Commit
·
78d6aa1
1
Parent(s):
5fcba04
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import os
|
3 |
+
os.environ["WOLFRAM_ALPHA_APPID"] = "G2RWL3-VWA9LPQQYH"
|
4 |
+
from langchain.utilities.wolfram_alpha import WolframAlphaAPIWrapper
|
5 |
+
wolfram = WolframAlphaAPIWrapper()
|
6 |
+
def answer(question):
|
7 |
+
out=wolfram.run(question)
|
8 |
+
return out
|
9 |
+
demo = gr.Interface(fn=answer, inputs='text',outputs='text',examples=[['Ram has 5 apples. He gives 3 to Shyam. How many apples does Ram have now?']])
|
10 |
+
demo.launch()
|