pentarosarium commited on
Commit
380afa6
·
1 Parent(s): 6eb9bd2
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -9,7 +9,7 @@ import io
9
  from rapidfuzz import fuzz
10
  import time
11
  import os
12
- os.environ['grow_key'] = 'groq_key'
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' in gr.secrets:
127
  self.groq = ChatOpenAI(
128
  base_url="https://api.groq.com/openai/v1",
129
  model="llama-3.1-70b-versatile",
130
- openai_api_key=gr.secrets['groq_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.25+")
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(