Update app.py
Browse files
app.py
CHANGED
@@ -43,6 +43,16 @@ pre, code {
|
|
43 |
|
44 |
system_prompt = str(os.getenv("SYSTEM_PROMPT"))
|
45 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
|
47 |
def execution_time_calculator(start_time, log=True):
|
48 |
delta = time.time() - start_time
|
@@ -75,7 +85,7 @@ def log_to_langfuse(message, chat_history, max_new_tokens, temperature, top_p, t
|
|
75 |
return "".join(model_outputs)
|
76 |
|
77 |
|
78 |
-
@spaces.
|
79 |
def generate(
|
80 |
message: str,
|
81 |
chat_history: list[tuple[str, str]],
|
|
|
43 |
|
44 |
system_prompt = str(os.getenv("SYSTEM_PROMPT"))
|
45 |
|
46 |
+
secret_key = str(os.getenv("LANGFUSE_SECRET_KEY"))
|
47 |
+
public_key = str(os.getenv("LANGFUSE_PUBLIC_KEY"))
|
48 |
+
host = str(os.getenv("LANGFUSE_HOST"))
|
49 |
+
|
50 |
+
langfuse = Langfuse(
|
51 |
+
secret_key=secret_key,
|
52 |
+
public_key=public_key,
|
53 |
+
host=host
|
54 |
+
)
|
55 |
+
|
56 |
|
57 |
def execution_time_calculator(start_time, log=True):
|
58 |
delta = time.time() - start_time
|
|
|
85 |
return "".join(model_outputs)
|
86 |
|
87 |
|
88 |
+
@spaces.CPU
|
89 |
def generate(
|
90 |
message: str,
|
91 |
chat_history: list[tuple[str, str]],
|