Spaces:
Running
Running
Commit
·
4ae9174
1
Parent(s):
03d6f04
add requiretment
Browse files
app.py
CHANGED
@@ -1,13 +1,13 @@
|
|
1 |
import gradio as gr
|
2 |
import subprocess
|
3 |
|
4 |
-
def greet(name1, name2, name3, name4
|
5 |
# Storing each input in a variable, you can process or save them as you like
|
6 |
str1 = name1
|
7 |
str2 = name2
|
8 |
str3 = name3
|
9 |
str4 = name4
|
10 |
-
|
11 |
|
12 |
def run_command(command):
|
13 |
result = subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
|
@@ -20,16 +20,19 @@ def greet(name1, name2, name3, name4, name5):
|
|
20 |
# output_string1, error_string1= run_command("pip install optogpt")
|
21 |
output_string1, error_string1=run_command("curl -sSL https://install.python-poetry.org | python3 -")
|
22 |
output_string2, error_string2= run_command(f"poetry run runoak set-apikey -e openai {str1}")
|
|
|
|
|
|
|
|
|
23 |
# output_string1, error_string1=run_command("poetry")# ontogpt")
|
24 |
|
25 |
# For the purpose of this example, I'm just returning the values concatenated
|
26 |
-
return f"Inputs received: {str1}, {str2}, {str3}, {str4},
|
27 |
|
28 |
# Define 5 text input boxes with labels
|
29 |
input_boxes = [
|
30 |
gr.inputs.Textbox(label="openai api key"),
|
31 |
gr.inputs.Textbox(label="bioportal api key"),
|
32 |
-
gr.inputs.Textbox(label="NCBI api key"),
|
33 |
gr.inputs.Textbox(label="HuggingFace Hub api key"),
|
34 |
gr.inputs.Textbox(label="Input data"),
|
35 |
]
|
|
|
1 |
import gradio as gr
|
2 |
import subprocess
|
3 |
|
4 |
+
def greet(name1, name2, name3, name4):
|
5 |
# Storing each input in a variable, you can process or save them as you like
|
6 |
str1 = name1
|
7 |
str2 = name2
|
8 |
str3 = name3
|
9 |
str4 = name4
|
10 |
+
|
11 |
|
12 |
def run_command(command):
|
13 |
result = subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
|
|
|
20 |
# output_string1, error_string1= run_command("pip install optogpt")
|
21 |
output_string1, error_string1=run_command("curl -sSL https://install.python-poetry.org | python3 -")
|
22 |
output_string2, error_string2= run_command(f"poetry run runoak set-apikey -e openai {str1}")
|
23 |
+
run_command(f"poetry run runoak set-apikey -e bioportal {str2}")
|
24 |
+
run_command(f"poetry run runoak set-apikey -e hfhub-key {str3}")
|
25 |
+
|
26 |
+
|
27 |
# output_string1, error_string1=run_command("poetry")# ontogpt")
|
28 |
|
29 |
# For the purpose of this example, I'm just returning the values concatenated
|
30 |
+
return f"Inputs received: {str1}, {str2}, {str3}, {str4}, {output_string1},{error_string1},{output_string2},{error_string2}"
|
31 |
|
32 |
# Define 5 text input boxes with labels
|
33 |
input_boxes = [
|
34 |
gr.inputs.Textbox(label="openai api key"),
|
35 |
gr.inputs.Textbox(label="bioportal api key"),
|
|
|
36 |
gr.inputs.Textbox(label="HuggingFace Hub api key"),
|
37 |
gr.inputs.Textbox(label="Input data"),
|
38 |
]
|