Spaces:
Running
Running
Germano Cavalcante
commited on
Commit
•
5974bb1
1
Parent(s):
0576e6d
Fix runtime errors in docker
Browse files- main.py +1 -1
- routers/tool_calls.py +4 -4
- routers/tool_wiki_search.py +2 -1
- routers/utils_gitea.py +2 -2
main.py
CHANGED
@@ -6,7 +6,7 @@ from fastapi.responses import HTMLResponse
|
|
6 |
from fastapi.staticfiles import StaticFiles
|
7 |
from huggingface_hub import login
|
8 |
from config import settings
|
9 |
-
from routers import tool_bpy_doc, tool_gpu_checker,
|
10 |
|
11 |
login(settings.huggingface_key)
|
12 |
|
|
|
6 |
from fastapi.staticfiles import StaticFiles
|
7 |
from huggingface_hub import login
|
8 |
from config import settings
|
9 |
+
from routers import tool_bpy_doc, tool_gpu_checker, tool_find_related, tool_wiki_search, tool_calls
|
10 |
|
11 |
login(settings.huggingface_key)
|
12 |
|
routers/tool_calls.py
CHANGED
@@ -10,10 +10,10 @@ try:
|
|
10 |
from .tool_find_related import find_related
|
11 |
from .tool_wiki_search import wiki_search
|
12 |
except:
|
13 |
-
from tool_gpu_checker import gpu_checker_get_message
|
14 |
-
from tool_bpy_doc import bpy_doc_get_documentation
|
15 |
-
from tool_find_related import find_related
|
16 |
-
from tool_wiki_search import wiki_search
|
17 |
|
18 |
|
19 |
class ToolCallFunction(BaseModel):
|
|
|
10 |
from .tool_find_related import find_related
|
11 |
from .tool_wiki_search import wiki_search
|
12 |
except:
|
13 |
+
from routers.tool_gpu_checker import gpu_checker_get_message
|
14 |
+
from routers.tool_bpy_doc import bpy_doc_get_documentation
|
15 |
+
from routers.tool_find_related import find_related
|
16 |
+
from routers.tool_wiki_search import wiki_search
|
17 |
|
18 |
|
19 |
class ToolCallFunction(BaseModel):
|
routers/tool_wiki_search.py
CHANGED
@@ -10,12 +10,13 @@ from typing import Dict, List
|
|
10 |
from sentence_transformers import util
|
11 |
from fastapi import APIRouter
|
12 |
from fastapi.responses import PlainTextResponse
|
13 |
-
from utils_gitea import gitea_wiki_page_get, gitea_wiki_pages_get
|
14 |
|
15 |
try:
|
16 |
from .embedding import EMBEDDING_CTX
|
|
|
17 |
except:
|
18 |
from embedding import EMBEDDING_CTX
|
|
|
19 |
|
20 |
MANUAL_DIR = "D:/BlenderDev/blender-manual/manual/"
|
21 |
|
|
|
10 |
from sentence_transformers import util
|
11 |
from fastapi import APIRouter
|
12 |
from fastapi.responses import PlainTextResponse
|
|
|
13 |
|
14 |
try:
|
15 |
from .embedding import EMBEDDING_CTX
|
16 |
+
from .utils_gitea import gitea_wiki_page_get, gitea_wiki_pages_get
|
17 |
except:
|
18 |
from embedding import EMBEDDING_CTX
|
19 |
+
from utils_gitea import gitea_wiki_page_get, gitea_wiki_pages_get
|
20 |
|
21 |
MANUAL_DIR = "D:/BlenderDev/blender-manual/manual/"
|
22 |
|
routers/utils_gitea.py
CHANGED
@@ -30,7 +30,7 @@ def url_json_get(url, data=None):
|
|
30 |
def url_json_get_all_pages(url, item_filter=None, limit=50, exclude=set(), verbose=False):
|
31 |
assert limit <= 50, "50 is the maximum limit of items per page"
|
32 |
|
33 |
-
url_for_page = f"{url}
|
34 |
|
35 |
with urllib.request.urlopen(url_for_page + '1') as response:
|
36 |
headers_first = response.info()
|
@@ -123,4 +123,4 @@ def gitea_wiki_pages_get(owner, repo, verbose=True):
|
|
123 |
Get all wiki pages.
|
124 |
"""
|
125 |
base_url = f"{BASE_API_URL}/repos/{owner}/{repo}/wiki/pages"
|
126 |
-
return
|
|
|
30 |
def url_json_get_all_pages(url, item_filter=None, limit=50, exclude=set(), verbose=False):
|
31 |
assert limit <= 50, "50 is the maximum limit of items per page"
|
32 |
|
33 |
+
url_for_page = f"{url}&limit={limit}&page="
|
34 |
|
35 |
with urllib.request.urlopen(url_for_page + '1') as response:
|
36 |
headers_first = response.info()
|
|
|
123 |
Get all wiki pages.
|
124 |
"""
|
125 |
base_url = f"{BASE_API_URL}/repos/{owner}/{repo}/wiki/pages"
|
126 |
+
return url_json_get(base_url)
|