Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
import gradio as gr
|
2 |
|
3 |
import torch
|
|
|
4 |
from transformers import AutoTokenizer, AutoModelForCausalLM, TextIteratorStreamer, pipeline
|
5 |
from threading import Thread
|
6 |
|
@@ -21,9 +22,9 @@ phi2 = pipeline(
|
|
21 |
device_map="cpu"
|
22 |
)
|
23 |
# DSPy-based prompt generation
|
24 |
-
from
|
25 |
-
from
|
26 |
-
from
|
27 |
|
28 |
def dspy_generate_agent_prompts(prompt):
|
29 |
"""
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
import torch
|
4 |
+
import dspy
|
5 |
from transformers import AutoTokenizer, AutoModelForCausalLM, TextIteratorStreamer, pipeline
|
6 |
from threading import Thread
|
7 |
|
|
|
22 |
device_map="cpu"
|
23 |
)
|
24 |
# DSPy-based prompt generation
|
25 |
+
from dspy.agents import Agent
|
26 |
+
from dspy import spawn_processes
|
27 |
+
from dspy.utils import SentenceSplitter, SentimentAnalyzer, NamedEntityRecognizer
|
28 |
|
29 |
def dspy_generate_agent_prompts(prompt):
|
30 |
"""
|