Spaces:
Running
Running
Commit
·
624e912
1
Parent(s):
4c644f1
Add application files
Browse files
app.py
CHANGED
@@ -20,7 +20,7 @@ def greet(name1, name2):
|
|
20 |
|
21 |
with open('abstractsave.txt', 'w') as f:
|
22 |
f.write(str4_input)
|
23 |
-
|
24 |
def run_command(command):
|
25 |
result = subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
|
26 |
|
@@ -34,7 +34,7 @@ def greet(name1, name2):
|
|
34 |
output_string2, error_string2 = run_command(f"poetry run runoak set-apikey -e openai {str1_openai}")
|
35 |
run_command(f"poetry run runoak set-apikey -e bioportal {str2_bioportal}")
|
36 |
run_command(f"poetry run runoak set-apikey -e hfhub-key {str3_huggingface}")
|
37 |
-
|
38 |
output = run_command(f"cancerontogpt extract -t cancer.CancerAnnotations -i ./abstractsave.txt")
|
39 |
|
40 |
output = output[0].replace('\\n', '\n')
|
@@ -50,8 +50,8 @@ def greet(name1, name2):
|
|
50 |
|
51 |
# Output the extracted text
|
52 |
output
|
53 |
-
|
54 |
-
|
55 |
|
56 |
#### output_string1, error_string1=run_command("poetry")# ontogpt")
|
57 |
|
@@ -61,14 +61,14 @@ def greet(name1, name2):
|
|
61 |
# return f"Inputs received: {str1} \n, {str2}, {str3}, {str4}, '--------------', '--------------', {output_string1},{error_string1},{output_string2},{error_string2},{output}"
|
62 |
# # return location
|
63 |
# For the purpose of this example, I'm just returning the values concatenated
|
64 |
-
return f"{
|
65 |
|
66 |
# Define 5 text input boxes with labels
|
67 |
input_boxes = [
|
68 |
gr.inputs.Textbox(label="openai api key"),
|
69 |
-
gr.inputs.Textbox(label="Input
|
70 |
]
|
71 |
|
72 |
-
iface = gr.Interface(fn=greet, inputs=input_boxes, outputs="text")
|
73 |
iface.launch()
|
74 |
|
|
|
20 |
|
21 |
with open('abstractsave.txt', 'w') as f:
|
22 |
f.write(str4_input)
|
23 |
+
'''
|
24 |
def run_command(command):
|
25 |
result = subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
|
26 |
|
|
|
34 |
output_string2, error_string2 = run_command(f"poetry run runoak set-apikey -e openai {str1_openai}")
|
35 |
run_command(f"poetry run runoak set-apikey -e bioportal {str2_bioportal}")
|
36 |
run_command(f"poetry run runoak set-apikey -e hfhub-key {str3_huggingface}")
|
37 |
+
##### output = run_command(f"ontogpt extract -t gocam.GoCamAnnotations -i ./abstract.txt")
|
38 |
output = run_command(f"cancerontogpt extract -t cancer.CancerAnnotations -i ./abstractsave.txt")
|
39 |
|
40 |
output = output[0].replace('\\n', '\n')
|
|
|
50 |
|
51 |
# Output the extracted text
|
52 |
output
|
53 |
+
'''
|
54 |
+
|
55 |
|
56 |
#### output_string1, error_string1=run_command("poetry")# ontogpt")
|
57 |
|
|
|
61 |
# return f"Inputs received: {str1} \n, {str2}, {str3}, {str4}, '--------------', '--------------', {output_string1},{error_string1},{output_string2},{error_string2},{output}"
|
62 |
# # return location
|
63 |
# For the purpose of this example, I'm just returning the values concatenated
|
64 |
+
return f"{str4_input}"
|
65 |
|
66 |
# Define 5 text input boxes with labels
|
67 |
input_boxes = [
|
68 |
gr.inputs.Textbox(label="openai api key"),
|
69 |
+
gr.inputs.Textbox(label="Input cencer report"),
|
70 |
]
|
71 |
|
72 |
+
iface = gr.Interface(fn=greet, lines=20, inputs=input_boxes, outputs="text")
|
73 |
iface.launch()
|
74 |
|