Solshine commited on
Commit
1e93487
1 Parent(s): 2e8b875

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -10,6 +10,11 @@ model_name = "Dolphin-Phi"
10
  # Load the chosen LLM model
11
  llm = pipeline("text-generation", model=Dolphin-Phi)
12
 
 
 
 
 
 
13
  # DSPy-based prompt generation
14
  from dspy.agents import Agent
15
  from dspy.utils import SentenceSplitter, SentimentAnalyzer, NamedEntityRecognizer
@@ -40,10 +45,10 @@ def dspy_generate_agent_prompts(prompt):
40
  for sentence in sentences:
41
  entities = ner.process(sentence)
42
  for entity in entities:
43
- if entity.label_ in ["FOOD", "ORG", "LOCATION"]: # Customize entity labels based on your needs
44
  extracted_entities.setdefault(entity.label_, []).append(entity.text)
45
 
46
- # 4. Craft prompts for each agent
47
  agent_prompts = []
48
 
49
  # **Sentiment Analyzer Prompt:**
 
10
  # Load the chosen LLM model
11
  llm = pipeline("text-generation", model=Dolphin-Phi)
12
 
13
+ #Vectara config:
14
+ # customer_id =
15
+ # corpus_id =
16
+ # api_key =
17
+
18
  # DSPy-based prompt generation
19
  from dspy.agents import Agent
20
  from dspy.utils import SentenceSplitter, SentimentAnalyzer, NamedEntityRecognizer
 
45
  for sentence in sentences:
46
  entities = ner.process(sentence)
47
  for entity in entities:
48
+ if entity.label_ in ["FOOD", "ORG", "LOCATION"]: # Customize entity labels based on needs
49
  extracted_entities.setdefault(entity.label_, []).append(entity.text)
50
 
51
+ # 4. Craft prompts for each agent (incomplete)
52
  agent_prompts = []
53
 
54
  # **Sentiment Analyzer Prompt:**