Spaces:
Sleeping
Sleeping
Pablo Sampaio
commited on
Commit
•
2369060
1
Parent(s):
ab00272
Merge branch 'main' of https://huggingface.co/spaces/pablo-sampaio/futeboy into main
Browse files- app.py +2 -1
- match_info_crawler.py +7 -6
app.py
CHANGED
@@ -223,7 +223,8 @@ else:
|
|
223 |
HF_KEY = os.environ['HUGGINGFACE_API_KEY']
|
224 |
|
225 |
# Serverless API endpoint for OpenAI's Whisper model
|
226 |
-
ASR_API_URL = "https://api-inference.huggingface.co/models/openai/whisper-large-v3"
|
|
|
227 |
ASR_API_HEADERS = {"Authorization": f"Bearer {HF_KEY}"}
|
228 |
|
229 |
|
|
|
223 |
HF_KEY = os.environ['HUGGINGFACE_API_KEY']
|
224 |
|
225 |
# Serverless API endpoint for OpenAI's Whisper model
|
226 |
+
#ASR_API_URL = "https://api-inference.huggingface.co/models/openai/whisper-large-v3"
|
227 |
+
ASR_API_URL = "https://api-inference.huggingface.co/models/openai/whisper-small"
|
228 |
ASR_API_HEADERS = {"Authorization": f"Bearer {HF_KEY}"}
|
229 |
|
230 |
|
match_info_crawler.py
CHANGED
@@ -20,7 +20,8 @@ load_dotenv(find_dotenv()) # should load the GOOGLE_API_KEY
|
|
20 |
genai.configure()
|
21 |
|
22 |
|
23 |
-
|
|
|
24 |
|
25 |
sao_paulo_timezone = pytz.timezone('America/Sao_Paulo')
|
26 |
|
@@ -45,11 +46,11 @@ Palmeiras 0 x 2 Atletico Paranaense - Campeonato Brasileiro - Série A - finishe
|
|
45 |
```
|
46 |
'''
|
47 |
|
48 |
-
if
|
49 |
-
EXTRACTOR_MODEL = genai.GenerativeModel(
|
50 |
-
|
51 |
else:
|
52 |
-
EXTRACTOR_MODEL = genai.GenerativeModel(
|
53 |
|
54 |
|
55 |
START_MAIS_POP_SECTION = "<h3 class='match-list_league-name'>MAIS POPULARES AGORA</h3>"
|
@@ -122,7 +123,7 @@ def get_matches_info(date_str: str):
|
|
122 |
#print("PROCESSING:\n", plain_page)
|
123 |
|
124 |
try:
|
125 |
-
if
|
126 |
#response = EXTRACTOR_MODEL.generate_content(plain_page)
|
127 |
response = EXTRACTOR_MODEL.generate_content("HTML PAGE TO BE PARSED: \n\n" + plain_page)
|
128 |
else:
|
|
|
20 |
genai.configure()
|
21 |
|
22 |
|
23 |
+
MODEL_VERSION = "gemini-1.5-flash"
|
24 |
+
#MODEL_VERSION = "gemini-1.0-pro"
|
25 |
|
26 |
sao_paulo_timezone = pytz.timezone('America/Sao_Paulo')
|
27 |
|
|
|
46 |
```
|
47 |
'''
|
48 |
|
49 |
+
if MODEL_VERSION != "gemini-1.0-pro":
|
50 |
+
EXTRACTOR_MODEL = genai.GenerativeModel(MODEL_VERSION,
|
51 |
+
system_instruction=SYSTEM_PROMPT) # TODO: setar uma temperatura bem baixa!
|
52 |
else:
|
53 |
+
EXTRACTOR_MODEL = genai.GenerativeModel(MODEL_VERSION)
|
54 |
|
55 |
|
56 |
START_MAIS_POP_SECTION = "<h3 class='match-list_league-name'>MAIS POPULARES AGORA</h3>"
|
|
|
123 |
#print("PROCESSING:\n", plain_page)
|
124 |
|
125 |
try:
|
126 |
+
if MODEL_VERSION != "gemini-1.0-pro":
|
127 |
#response = EXTRACTOR_MODEL.generate_content(plain_page)
|
128 |
response = EXTRACTOR_MODEL.generate_content("HTML PAGE TO BE PARSED: \n\n" + plain_page)
|
129 |
else:
|