gmshroff commited on
Commit
c7ef637
1 Parent(s): 3a06cc8

added numerapi to req

Browse files
Files changed (2) hide show
  1. app.py +3 -5
  2. requirements.txt +1 -1
app.py CHANGED
@@ -6,15 +6,13 @@ import os
6
  anvil.server.connect('55MH4EBKM22EP4E6D5T6CVSL-VGO5X4SM6JEXGJVT')
7
  import json
8
  import ast
9
- def my_inference_function(name):
10
- # print(ast.literal_eval(name)['name'])
11
- os.system(name+' > ./out.txt')
12
  with open('./out.txt','r') as f: output=f.read()
13
  return output
14
- # return "Input Data: " + name + ", stay tuned for ML models from this API"
15
 
16
  gradio_interface = gr.Interface(
17
- fn=my_inference_function,
18
  inputs="text",
19
  outputs="text",
20
  title="REST API with Gradio and Huggingface Spaces",
 
6
  anvil.server.connect('55MH4EBKM22EP4E6D5T6CVSL-VGO5X4SM6JEXGJVT')
7
  import json
8
  import ast
9
+ def run_script(scriptname):
10
+ os.system(scriptname+' > ./out.txt')
 
11
  with open('./out.txt','r') as f: output=f.read()
12
  return output
 
13
 
14
  gradio_interface = gr.Interface(
15
+ fn=run_script,
16
  inputs="text",
17
  outputs="text",
18
  title="REST API with Gradio and Huggingface Spaces",
requirements.txt CHANGED
@@ -1,2 +1,2 @@
1
  anvil_uplink
2
- PyPDF2
 
1
  anvil_uplink
2
+ numerapi