Spaces:
Sleeping
Sleeping
Commit
·
380afa6
1
Parent(s):
6eb9bd2
v.1.26
Browse files
app.py
CHANGED
@@ -9,7 +9,7 @@ import io
|
|
9 |
from rapidfuzz import fuzz
|
10 |
import time
|
11 |
import os
|
12 |
-
os.environ['
|
13 |
|
14 |
def fuzzy_deduplicate(df, column, threshold=55):
|
15 |
"""Deduplicate rows based on fuzzy matching of text content"""
|
@@ -123,11 +123,11 @@ class EventDetector:
|
|
123 |
self.model = AutoModelForSeq2SeqLM.from_pretrained(self.model_name).to(device)
|
124 |
|
125 |
# Initialize Groq
|
126 |
-
if 'groq_key'
|
127 |
self.groq = ChatOpenAI(
|
128 |
base_url="https://api.groq.com/openai/v1",
|
129 |
model="llama-3.1-70b-versatile",
|
130 |
-
openai_api_key=
|
131 |
temperature=0.0
|
132 |
)
|
133 |
else:
|
@@ -528,7 +528,7 @@ def create_interface():
|
|
528 |
control = ProcessControl()
|
529 |
|
530 |
with gr.Blocks(theme=gr.themes.Soft()) as app:
|
531 |
-
gr.Markdown("# AI-анализ мониторинга новостей v.1.
|
532 |
|
533 |
with gr.Row():
|
534 |
file_input = gr.File(
|
|
|
9 |
from rapidfuzz import fuzz
|
10 |
import time
|
11 |
import os
|
12 |
+
groq_key = os.environ['groq_key']
|
13 |
|
14 |
def fuzzy_deduplicate(df, column, threshold=55):
|
15 |
"""Deduplicate rows based on fuzzy matching of text content"""
|
|
|
123 |
self.model = AutoModelForSeq2SeqLM.from_pretrained(self.model_name).to(device)
|
124 |
|
125 |
# Initialize Groq
|
126 |
+
if 'groq_key':
|
127 |
self.groq = ChatOpenAI(
|
128 |
base_url="https://api.groq.com/openai/v1",
|
129 |
model="llama-3.1-70b-versatile",
|
130 |
+
openai_api_key=groq_key,
|
131 |
temperature=0.0
|
132 |
)
|
133 |
else:
|
|
|
528 |
control = ProcessControl()
|
529 |
|
530 |
with gr.Blocks(theme=gr.themes.Soft()) as app:
|
531 |
+
gr.Markdown("# AI-анализ мониторинга новостей v.1.26")
|
532 |
|
533 |
with gr.Row():
|
534 |
file_input = gr.File(
|