Spaces:
Running
Running
Commit
·
f5edb28
1
Parent(s):
3146e54
add requiretment
Browse files
app.py
CHANGED
@@ -11,7 +11,7 @@ def greet(name1, name2, name3, name4):
|
|
11 |
with open('abstractsave.txt', 'w') as f:
|
12 |
f.write(name4)
|
13 |
|
14 |
-
|
15 |
result = subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
|
16 |
|
17 |
output_string = result.stdout
|
@@ -19,7 +19,7 @@ def greet(name1, name2, name3, name4):
|
|
19 |
|
20 |
return output_string, error_string
|
21 |
|
22 |
-
|
23 |
output_string1, error_string1=run_command("curl -sSL https://install.python-poetry.org | python3 -")
|
24 |
output_string2, error_string2= run_command(f"poetry run runoak set-apikey -e openai {str1}")
|
25 |
run_command(f"poetry run runoak set-apikey -e bioportal {str2}")
|
@@ -32,21 +32,21 @@ def greet(name1, name2, name3, name4):
|
|
32 |
|
33 |
# For the purpose of this example, I'm just returning the values concatenated
|
34 |
return f"Inputs received: {str1}, {str2}, {str3}, {str4}, {output_string1},{error_string1},{output_string2},{error_string2},{output}"
|
35 |
-
|
36 |
|
37 |
-
|
38 |
-
|
39 |
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
|
51 |
# Define 5 text input boxes with labels
|
52 |
input_boxes = [
|
|
|
11 |
with open('abstractsave.txt', 'w') as f:
|
12 |
f.write(name4)
|
13 |
|
14 |
+
def run_command(command):
|
15 |
result = subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
|
16 |
|
17 |
output_string = result.stdout
|
|
|
19 |
|
20 |
return output_string, error_string
|
21 |
|
22 |
+
output_string1, error_string1= run_command("pip install optogpt")
|
23 |
output_string1, error_string1=run_command("curl -sSL https://install.python-poetry.org | python3 -")
|
24 |
output_string2, error_string2= run_command(f"poetry run runoak set-apikey -e openai {str1}")
|
25 |
run_command(f"poetry run runoak set-apikey -e bioportal {str2}")
|
|
|
32 |
|
33 |
# For the purpose of this example, I'm just returning the values concatenated
|
34 |
return f"Inputs received: {str1}, {str2}, {str3}, {str4}, {output_string1},{error_string1},{output_string2},{error_string2},{output}"
|
35 |
+
|
36 |
|
37 |
+
# import site
|
38 |
+
# import os
|
39 |
|
40 |
+
# def get_package_location(package_name):
|
41 |
+
# for directory in site.getsitepackages():
|
42 |
+
# package_path = os.path.join(directory, package_name)
|
43 |
+
# if os.path.exists(package_path):
|
44 |
+
# return package_path
|
45 |
+
# return 'not found'
|
46 |
|
47 |
+
# package_name = "ontogpt" # You can replace this with any package name
|
48 |
+
# location = get_package_location(package_name)
|
49 |
+
# return location
|
50 |
|
51 |
# Define 5 text input boxes with labels
|
52 |
input_boxes = [
|