Spaces:
Running
on
T4
Running
on
T4
SandLogicTechnologies
commited on
Commit
•
3080342
1
Parent(s):
7eadca5
Update app.py
Browse files
app.py
CHANGED
@@ -5,6 +5,7 @@ from typing import Iterator
|
|
5 |
import gradio as gr
|
6 |
import spaces
|
7 |
import torch
|
|
|
8 |
from transformers import AutoModelForCausalLM, AutoTokenizer, TextIteratorStreamer
|
9 |
|
10 |
|
@@ -45,7 +46,7 @@ def generate(
|
|
45 |
for user, assistant in chat_history:
|
46 |
conversation.extend(
|
47 |
[
|
48 |
-
os.getenv("PROMPT"),
|
49 |
{"role": "user", "content": user},
|
50 |
{"role": "assistant", "content": assistant},
|
51 |
]
|
|
|
5 |
import gradio as gr
|
6 |
import spaces
|
7 |
import torch
|
8 |
+
import json
|
9 |
from transformers import AutoModelForCausalLM, AutoTokenizer, TextIteratorStreamer
|
10 |
|
11 |
|
|
|
46 |
for user, assistant in chat_history:
|
47 |
conversation.extend(
|
48 |
[
|
49 |
+
json.loads(os.getenv("PROMPT")),
|
50 |
{"role": "user", "content": user},
|
51 |
{"role": "assistant", "content": assistant},
|
52 |
]
|