Spaces:
Running
Running
Huy Nguyen
commited on
Commit
·
19ac67f
1
Parent(s):
7476c3c
update to python310 image
Browse files- Dockerfile +1 -1
- __pycache__/main.cpython-312.pyc +0 -0
- env.py +3 -1
- flashcard_util.py +1 -1
- imgsearch.py +2 -3
- jsonview.txt +0 -0
- main.py +1 -1
Dockerfile
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
FROM python:3.
|
2 |
|
3 |
WORKDIR /code
|
4 |
|
|
|
1 |
+
FROM python:3.10
|
2 |
|
3 |
WORKDIR /code
|
4 |
|
__pycache__/main.cpython-312.pyc
ADDED
Binary file (21.5 kB). View file
|
|
env.py
CHANGED
@@ -1 +1,3 @@
|
|
1 |
-
LLM_API_KEY = "c9f1a8cb-994b-4e3a-931b-406c4b09ad73"
|
|
|
|
|
|
1 |
+
LLM_API_KEY = "c9f1a8cb-994b-4e3a-931b-406c4b09ad73"
|
2 |
+
GOOGLE_API_KEY = "AIzaSyDCeLIVjhVtoPFqrUym2OkfT2_7hRz1ORY"
|
3 |
+
CX = "54c182394edb24bc3"
|
flashcard_util.py
CHANGED
@@ -77,4 +77,4 @@ def get_imgs_from_words(words: list[str]):
|
|
77 |
pass
|
78 |
|
79 |
def classify_words(words: list[str], deep: bool = False):
|
80 |
-
pass
|
|
|
77 |
pass
|
78 |
|
79 |
def classify_words(words: list[str], deep: bool = False):
|
80 |
+
pass
|
imgsearch.py
CHANGED
@@ -1,8 +1,7 @@
|
|
1 |
import requests
|
2 |
from random import choice
|
|
|
3 |
|
4 |
-
GOOGLE_API_KEY = "AIzaSyDCeLIVjhVtoPFqrUym2OkfT2_7hRz1ORY"
|
5 |
-
CX = "54c182394edb24bc3"
|
6 |
def search_img(term):
|
7 |
_ret = requests.get(
|
8 |
url=f"https://www.googleapis.com/customsearch/v1?key={GOOGLE_API_KEY}&cx={CX}&q={term}&searchType=image&fields=items(link)"
|
@@ -11,4 +10,4 @@ def search_img(term):
|
|
11 |
return choice(_ret.json()['items'][:10])['link']
|
12 |
except:
|
13 |
print(_ret.json())
|
14 |
-
return ""
|
|
|
1 |
import requests
|
2 |
from random import choice
|
3 |
+
from env import GOOGLE_API_KEY, CX
|
4 |
|
|
|
|
|
5 |
def search_img(term):
|
6 |
_ret = requests.get(
|
7 |
url=f"https://www.googleapis.com/customsearch/v1?key={GOOGLE_API_KEY}&cx={CX}&q={term}&searchType=image&fields=items(link)"
|
|
|
10 |
return choice(_ret.json()['items'][:10])['link']
|
11 |
except:
|
12 |
print(_ret.json())
|
13 |
+
return ""
|
jsonview.txt
DELETED
Binary file (27.2 kB)
|
|
main.py
CHANGED
@@ -141,7 +141,7 @@ async def __parse_paragraphs (content: str, batching: bool = False):
|
|
141 |
|
142 |
return _p_json
|
143 |
|
144 |
-
async def __query_ml_predict(qtype:QType, content: str, header: str, token_limit: int, num_qs=5, l=lang.VI_VN):
|
145 |
"""Get prediction from a third-party Llama3-8B-Instruct deployment"""
|
146 |
stopwatch = time()
|
147 |
|
|
|
141 |
|
142 |
return _p_json
|
143 |
|
144 |
+
async def __query_ml_predict(qtype: QType, content: str, header: str, token_limit: int, num_qs=5, l=lang.VI_VN):
|
145 |
"""Get prediction from a third-party Llama3-8B-Instruct deployment"""
|
146 |
stopwatch = time()
|
147 |
|