Spaces:
Runtime error
Runtime error
Commit
·
8729297
1
Parent(s):
d093c72
Upload folder using huggingface_hub
Browse files- app.py +3 -0
- temp.ipynb +39 -3
app.py
CHANGED
@@ -1,5 +1,8 @@
|
|
1 |
import os
|
2 |
import git
|
|
|
|
|
|
|
3 |
|
4 |
|
5 |
username = os.environ['GIT_USERNAME']
|
|
|
1 |
import os
|
2 |
import git
|
3 |
+
import sys
|
4 |
+
|
5 |
+
sys.path.append("deployment_app")
|
6 |
|
7 |
|
8 |
username = os.environ['GIT_USERNAME']
|
temp.ipynb
CHANGED
@@ -11,7 +11,7 @@
|
|
11 |
},
|
12 |
{
|
13 |
"cell_type": "code",
|
14 |
-
"execution_count":
|
15 |
"metadata": {},
|
16 |
"outputs": [
|
17 |
{
|
@@ -21,7 +21,7 @@
|
|
21 |
"traceback": [
|
22 |
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
|
23 |
"\u001b[0;31mGitCommandError\u001b[0m Traceback (most recent call last)",
|
24 |
-
"\u001b[1;32m/Users/aakashbhatnagar/Documents/masters/drvai-beta-deployment/temp.ipynb Cell 2\u001b[0m line \u001b[0;36m1\n\u001b[0;32m----> <a href='vscode-notebook-cell:/Users/aakashbhatnagar/Documents/masters/drvai-beta-deployment/temp.ipynb#W4sZmlsZQ%3D%3D?line=0'>1</a>\u001b[0m Repo\u001b[39m.\u001b[39;49mclone_from(\u001b[39m\"\u001b[39;49m\u001b[39mhttps://github.com/krishnaadithya/ophthal_llm\u001b[39;49m\u001b[39m\"\u001b[39;49m, \u001b[39m\"\u001b[39;49m\u001b[39m/Users/aakashbhatnagar/Documents/masters/drvai-beta-deployment/ophthal_llm\u001b[39;49m\u001b[39m\"\u001b[39;49m)\n",
|
25 |
"File \u001b[0;32m/opt/homebrew/lib/python3.11/site-packages/git/repo/base.py:1328\u001b[0m, in \u001b[0;36mRepo.clone_from\u001b[0;34m(cls, url, to_path, progress, env, multi_options, allow_unsafe_protocols, allow_unsafe_options, **kwargs)\u001b[0m\n\u001b[1;32m 1326\u001b[0m \u001b[39mif\u001b[39;00m env \u001b[39mis\u001b[39;00m \u001b[39mnot\u001b[39;00m \u001b[39mNone\u001b[39;00m:\n\u001b[1;32m 1327\u001b[0m git\u001b[39m.\u001b[39mupdate_environment(\u001b[39m*\u001b[39m\u001b[39m*\u001b[39menv)\n\u001b[0;32m-> 1328\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mcls\u001b[39;49m\u001b[39m.\u001b[39;49m_clone(\n\u001b[1;32m 1329\u001b[0m git,\n\u001b[1;32m 1330\u001b[0m url,\n\u001b[1;32m 1331\u001b[0m to_path,\n\u001b[1;32m 1332\u001b[0m GitCmdObjectDB,\n\u001b[1;32m 1333\u001b[0m progress,\n\u001b[1;32m 1334\u001b[0m multi_options,\n\u001b[1;32m 1335\u001b[0m allow_unsafe_protocols\u001b[39m=\u001b[39;49mallow_unsafe_protocols,\n\u001b[1;32m 1336\u001b[0m allow_unsafe_options\u001b[39m=\u001b[39;49mallow_unsafe_options,\n\u001b[1;32m 1337\u001b[0m \u001b[39m*\u001b[39;49m\u001b[39m*\u001b[39;49mkwargs,\n\u001b[1;32m 1338\u001b[0m )\n",
|
26 |
"File \u001b[0;32m/opt/homebrew/lib/python3.11/site-packages/git/repo/base.py:1237\u001b[0m, in \u001b[0;36mRepo._clone\u001b[0;34m(cls, git, url, path, odb_default_type, progress, multi_options, allow_unsafe_protocols, allow_unsafe_options, **kwargs)\u001b[0m\n\u001b[1;32m 1234\u001b[0m cmdline \u001b[39m=\u001b[39m remove_password_if_present(cmdline)\n\u001b[1;32m 1236\u001b[0m log\u001b[39m.\u001b[39mdebug(\u001b[39m\"\u001b[39m\u001b[39mCmd(\u001b[39m\u001b[39m%s\u001b[39;00m\u001b[39m)\u001b[39m\u001b[39m'\u001b[39m\u001b[39ms unused stdout: \u001b[39m\u001b[39m%s\u001b[39;00m\u001b[39m\"\u001b[39m, cmdline, stdout)\n\u001b[0;32m-> 1237\u001b[0m finalize_process(proc, stderr\u001b[39m=\u001b[39;49mstderr)\n\u001b[1;32m 1239\u001b[0m \u001b[39m# our git command could have a different working dir than our actual\u001b[39;00m\n\u001b[1;32m 1240\u001b[0m \u001b[39m# environment, hence we prepend its working dir if required\u001b[39;00m\n\u001b[1;32m 1241\u001b[0m \u001b[39mif\u001b[39;00m \u001b[39mnot\u001b[39;00m osp\u001b[39m.\u001b[39misabs(path):\n",
|
27 |
"File \u001b[0;32m/opt/homebrew/lib/python3.11/site-packages/git/util.py:453\u001b[0m, in \u001b[0;36mfinalize_process\u001b[0;34m(proc, **kwargs)\u001b[0m\n\u001b[1;32m 451\u001b[0m \u001b[39m\u001b[39m\u001b[39m\"\"\"Wait for the process (clone, fetch, pull or push) and handle its errors accordingly\"\"\"\u001b[39;00m\n\u001b[1;32m 452\u001b[0m \u001b[39m# TODO: No close proc-streams??\u001b[39;00m\n\u001b[0;32m--> 453\u001b[0m proc\u001b[39m.\u001b[39;49mwait(\u001b[39m*\u001b[39;49m\u001b[39m*\u001b[39;49mkwargs)\n",
|
@@ -36,7 +36,7 @@
|
|
36 |
},
|
37 |
{
|
38 |
"cell_type": "code",
|
39 |
-
"execution_count":
|
40 |
"metadata": {},
|
41 |
"outputs": [
|
42 |
{
|
@@ -66,6 +66,42 @@
|
|
66 |
"print(f\"Repository cloned to {repo.working_dir}\")\n"
|
67 |
]
|
68 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
{
|
70 |
"cell_type": "code",
|
71 |
"execution_count": null,
|
|
|
11 |
},
|
12 |
{
|
13 |
"cell_type": "code",
|
14 |
+
"execution_count": 5,
|
15 |
"metadata": {},
|
16 |
"outputs": [
|
17 |
{
|
|
|
21 |
"traceback": [
|
22 |
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
|
23 |
"\u001b[0;31mGitCommandError\u001b[0m Traceback (most recent call last)",
|
24 |
+
"\u001b[1;32m/Users/aakashbhatnagar/Documents/masters/drvai-beta-deployment/temp.ipynb Cell 2\u001b[0m line \u001b[0;36m1\n\u001b[0;32m----> <a href='vscode-notebook-cell:/Users/aakashbhatnagar/Documents/masters/drvai-beta-deployment/temp.ipynb#W4sZmlsZQ%3D%3D?line=0'>1</a>\u001b[0m Repo\u001b[39m.\u001b[39;49mclone_from(\u001b[39m\"\u001b[39;49m\u001b[39mhttps://github.com/krishnaadithya/ophthal_llm\u001b[39;49m\u001b[39m\"\u001b[39;49m, \u001b[39m\"\u001b[39;49m\u001b[39m/Users/aakashbhatnagar/Documents/masters/drvai-beta-deployment/ophthal_llm\u001b[39;49m\u001b[39m\"\u001b[39;49m, )\n",
|
25 |
"File \u001b[0;32m/opt/homebrew/lib/python3.11/site-packages/git/repo/base.py:1328\u001b[0m, in \u001b[0;36mRepo.clone_from\u001b[0;34m(cls, url, to_path, progress, env, multi_options, allow_unsafe_protocols, allow_unsafe_options, **kwargs)\u001b[0m\n\u001b[1;32m 1326\u001b[0m \u001b[39mif\u001b[39;00m env \u001b[39mis\u001b[39;00m \u001b[39mnot\u001b[39;00m \u001b[39mNone\u001b[39;00m:\n\u001b[1;32m 1327\u001b[0m git\u001b[39m.\u001b[39mupdate_environment(\u001b[39m*\u001b[39m\u001b[39m*\u001b[39menv)\n\u001b[0;32m-> 1328\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mcls\u001b[39;49m\u001b[39m.\u001b[39;49m_clone(\n\u001b[1;32m 1329\u001b[0m git,\n\u001b[1;32m 1330\u001b[0m url,\n\u001b[1;32m 1331\u001b[0m to_path,\n\u001b[1;32m 1332\u001b[0m GitCmdObjectDB,\n\u001b[1;32m 1333\u001b[0m progress,\n\u001b[1;32m 1334\u001b[0m multi_options,\n\u001b[1;32m 1335\u001b[0m allow_unsafe_protocols\u001b[39m=\u001b[39;49mallow_unsafe_protocols,\n\u001b[1;32m 1336\u001b[0m allow_unsafe_options\u001b[39m=\u001b[39;49mallow_unsafe_options,\n\u001b[1;32m 1337\u001b[0m \u001b[39m*\u001b[39;49m\u001b[39m*\u001b[39;49mkwargs,\n\u001b[1;32m 1338\u001b[0m )\n",
|
26 |
"File \u001b[0;32m/opt/homebrew/lib/python3.11/site-packages/git/repo/base.py:1237\u001b[0m, in \u001b[0;36mRepo._clone\u001b[0;34m(cls, git, url, path, odb_default_type, progress, multi_options, allow_unsafe_protocols, allow_unsafe_options, **kwargs)\u001b[0m\n\u001b[1;32m 1234\u001b[0m cmdline \u001b[39m=\u001b[39m remove_password_if_present(cmdline)\n\u001b[1;32m 1236\u001b[0m log\u001b[39m.\u001b[39mdebug(\u001b[39m\"\u001b[39m\u001b[39mCmd(\u001b[39m\u001b[39m%s\u001b[39;00m\u001b[39m)\u001b[39m\u001b[39m'\u001b[39m\u001b[39ms unused stdout: \u001b[39m\u001b[39m%s\u001b[39;00m\u001b[39m\"\u001b[39m, cmdline, stdout)\n\u001b[0;32m-> 1237\u001b[0m finalize_process(proc, stderr\u001b[39m=\u001b[39;49mstderr)\n\u001b[1;32m 1239\u001b[0m \u001b[39m# our git command could have a different working dir than our actual\u001b[39;00m\n\u001b[1;32m 1240\u001b[0m \u001b[39m# environment, hence we prepend its working dir if required\u001b[39;00m\n\u001b[1;32m 1241\u001b[0m \u001b[39mif\u001b[39;00m \u001b[39mnot\u001b[39;00m osp\u001b[39m.\u001b[39misabs(path):\n",
|
27 |
"File \u001b[0;32m/opt/homebrew/lib/python3.11/site-packages/git/util.py:453\u001b[0m, in \u001b[0;36mfinalize_process\u001b[0;34m(proc, **kwargs)\u001b[0m\n\u001b[1;32m 451\u001b[0m \u001b[39m\u001b[39m\u001b[39m\"\"\"Wait for the process (clone, fetch, pull or push) and handle its errors accordingly\"\"\"\u001b[39;00m\n\u001b[1;32m 452\u001b[0m \u001b[39m# TODO: No close proc-streams??\u001b[39;00m\n\u001b[0;32m--> 453\u001b[0m proc\u001b[39m.\u001b[39;49mwait(\u001b[39m*\u001b[39;49m\u001b[39m*\u001b[39;49mkwargs)\n",
|
|
|
36 |
},
|
37 |
{
|
38 |
"cell_type": "code",
|
39 |
+
"execution_count": 6,
|
40 |
"metadata": {},
|
41 |
"outputs": [
|
42 |
{
|
|
|
66 |
"print(f\"Repository cloned to {repo.working_dir}\")\n"
|
67 |
]
|
68 |
},
|
69 |
+
{
|
70 |
+
"cell_type": "code",
|
71 |
+
"execution_count": 1,
|
72 |
+
"metadata": {},
|
73 |
+
"outputs": [],
|
74 |
+
"source": [
|
75 |
+
"import sys\n",
|
76 |
+
"import os\n",
|
77 |
+
"\n",
|
78 |
+
"sys.path.append(\"deployment_app\")"
|
79 |
+
]
|
80 |
+
},
|
81 |
+
{
|
82 |
+
"cell_type": "code",
|
83 |
+
"execution_count": 2,
|
84 |
+
"metadata": {},
|
85 |
+
"outputs": [
|
86 |
+
{
|
87 |
+
"ename": "ModuleNotFoundError",
|
88 |
+
"evalue": "No module named 'pymongo'",
|
89 |
+
"output_type": "error",
|
90 |
+
"traceback": [
|
91 |
+
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
|
92 |
+
"\u001b[0;31mModuleNotFoundError\u001b[0m Traceback (most recent call last)",
|
93 |
+
"\u001b[1;32m/Users/aakashbhatnagar/Documents/masters/drvai-beta-deployment/temp.ipynb Cell 5\u001b[0m line \u001b[0;36m2\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/aakashbhatnagar/Documents/masters/drvai-beta-deployment/temp.ipynb#W6sZmlsZQ%3D%3D?line=0'>1</a>\u001b[0m \u001b[39m# %cd deployment_app\u001b[39;00m\n\u001b[0;32m----> <a href='vscode-notebook-cell:/Users/aakashbhatnagar/Documents/masters/drvai-beta-deployment/temp.ipynb#W6sZmlsZQ%3D%3D?line=1'>2</a>\u001b[0m \u001b[39mfrom\u001b[39;00m \u001b[39mdeployment_app\u001b[39;00m\u001b[39m.\u001b[39;00m\u001b[39mconversation\u001b[39;00m \u001b[39mimport\u001b[39;00m make_conversation\n",
|
94 |
+
"File \u001b[0;32m~/Documents/masters/drvai-beta-deployment/deployment_app/conversation.py:139\u001b[0m\n\u001b[1;32m 136\u001b[0m \u001b[39mimport\u001b[39;00m \u001b[39msys\u001b[39;00m\n\u001b[1;32m 138\u001b[0m sys\u001b[39m.\u001b[39mpath\u001b[39m.\u001b[39mappend(\u001b[39m\"\u001b[39m\u001b[39m..\u001b[39m\u001b[39m\"\u001b[39m)\n\u001b[0;32m--> 139\u001b[0m \u001b[39mfrom\u001b[39;00m \u001b[39mdb_func\u001b[39;00m \u001b[39mimport\u001b[39;00m insert_one\n\u001b[1;32m 140\u001b[0m \u001b[39m# from langchain.agents import AgentExecutor\u001b[39;00m\n\u001b[1;32m 141\u001b[0m \u001b[39m# import wordninja\u001b[39;00m\n\u001b[1;32m 143\u001b[0m \u001b[39mdef\u001b[39;00m \u001b[39mclean_text\u001b[39m(text):\n",
|
95 |
+
"File \u001b[0;32m~/Documents/masters/drvai-beta-deployment/deployment_app/db_func.py:2\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[39mimport\u001b[39;00m \u001b[39mos\u001b[39;00m\n\u001b[0;32m----> 2\u001b[0m \u001b[39mimport\u001b[39;00m \u001b[39mpymongo\u001b[39;00m\n\u001b[1;32m 4\u001b[0m user_name \u001b[39m=\u001b[39m os\u001b[39m.\u001b[39mgetenv(\u001b[39m\"\u001b[39m\u001b[39mMONGO_DB_USERNAME\u001b[39m\u001b[39m\"\u001b[39m)\n\u001b[1;32m 5\u001b[0m password \u001b[39m=\u001b[39m os\u001b[39m.\u001b[39mgetenv(\u001b[39m\"\u001b[39m\u001b[39mMONGO_DB_PASSWORD\u001b[39m\u001b[39m\"\u001b[39m)\n",
|
96 |
+
"\u001b[0;31mModuleNotFoundError\u001b[0m: No module named 'pymongo'"
|
97 |
+
]
|
98 |
+
}
|
99 |
+
],
|
100 |
+
"source": [
|
101 |
+
"# %cd deployment_app\n",
|
102 |
+
"from deployment_app.conversation import make_conversation"
|
103 |
+
]
|
104 |
+
},
|
105 |
{
|
106 |
"cell_type": "code",
|
107 |
"execution_count": null,
|