Spaces:
Sleeping
Sleeping
Commit
·
ce3885b
1
Parent(s):
f5edb28
add requiretment
Browse files
app.py
CHANGED
@@ -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}")
|
@@ -30,23 +30,24 @@ def greet(name1, name2, name3, name4):
|
|
30 |
# output_string1, error_string1=run_command("poetry")# ontogpt")
|
31 |
|
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 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
|
|
|
|
|
|
46 |
|
47 |
-
|
48 |
-
|
49 |
# return location
|
|
|
|
|
|
|
50 |
|
51 |
# Define 5 text input boxes with labels
|
52 |
input_boxes = [
|
|
|
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}")
|
|
|
30 |
# output_string1, error_string1=run_command("poetry")# ontogpt")
|
31 |
|
32 |
|
|
|
|
|
|
|
33 |
|
|
|
|
|
34 |
|
35 |
+
import site
|
36 |
+
import os
|
37 |
+
|
38 |
+
def get_package_location(package_name):
|
39 |
+
for directory in site.getsitepackages():
|
40 |
+
package_path = os.path.join(directory, package_name)
|
41 |
+
if os.path.exists(package_path):
|
42 |
+
return package_path
|
43 |
+
return 'not found'
|
44 |
|
45 |
+
package_name = "ontogpt" # You can replace this with any package name
|
46 |
+
location = get_package_location(package_name)
|
47 |
# return location
|
48 |
+
# For the purpose of this example, I'm just returning the values concatenated
|
49 |
+
return f"Inputs received: {str1}, {str2}, {str3}, {str4}, {location}, {output_string1},{error_string1},{output_string2},{error_string2},{output}"
|
50 |
+
|
51 |
|
52 |
# Define 5 text input boxes with labels
|
53 |
input_boxes = [
|