Update services/llama_generator.py
Browse files- services/llama_generator.py +20 -0
services/llama_generator.py
CHANGED
@@ -1,6 +1,26 @@
|
|
1 |
# llama_generator.py
|
2 |
from config.config import GenerationConfig, ModelConfig
|
3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
@observe()
|
5 |
class LlamaGenerator(BaseGenerator):
|
6 |
def __init__(
|
|
|
1 |
# llama_generator.py
|
2 |
from config.config import GenerationConfig, ModelConfig
|
3 |
|
4 |
+
from typing import List, Dict, Any, Optional, Tuple
|
5 |
+
from datetime import datetime
|
6 |
+
import logging
|
7 |
+
from config.config import settings
|
8 |
+
import asyncio
|
9 |
+
from io import StringIO
|
10 |
+
import pandas as pd
|
11 |
+
|
12 |
+
# Initialize Langfuse
|
13 |
+
os.environ["LANGFUSE_PUBLIC_KEY"] = "pk-lf-9f2c32d2-266f-421d-9b87-51377f0a268c"
|
14 |
+
os.environ["LANGFUSE_SECRET_KEY"] = "sk-lf-229e10c5-6210-4a4b-a432-0f17bc66e56c"
|
15 |
+
os.environ["LANGFUSE_HOST"] = "https://chris4k-langfuse-template-space.hf.space" # 🇪🇺 EU region
|
16 |
+
|
17 |
+
try:
|
18 |
+
langfuse = Langfuse()
|
19 |
+
except Exception as e:
|
20 |
+
print("Langfuse Offline")
|
21 |
+
|
22 |
+
|
23 |
+
|
24 |
@observe()
|
25 |
class LlamaGenerator(BaseGenerator):
|
26 |
def __init__(
|