Spaces:
Runtime error
Runtime error
first commit
Browse files
app.py
CHANGED
@@ -1,14 +1,12 @@
|
|
1 |
import streamlit as st
|
2 |
-
import torch
|
3 |
# Load model directly
|
4 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
5 |
|
6 |
-
|
7 |
-
|
8 |
-
tokenizer_open_chat = AutoTokenizer.from_pretrained("openchat/openchat_3.5")
|
9 |
prompt = ""
|
10 |
-
model_input =
|
11 |
-
response =
|
12 |
|
13 |
prompt = st.chat_input("Say something")
|
14 |
if prompt:
|
|
|
1 |
import streamlit as st
|
|
|
2 |
# Load model directly
|
3 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
4 |
|
5 |
+
tokenizer = AutoTokenizer.from_pretrained("openchat/openchat")
|
6 |
+
model = AutoModelForCausalLM.from_pretrained("openchat/openchat")
|
|
|
7 |
prompt = ""
|
8 |
+
model_input = tokenizer(prompt, return_tensors="pt").to("cuda")
|
9 |
+
response = tokenizer.decode(model.generate(**model_input,temperature=0.1, max_length=5000)[0], skip_special_tokens=True)
|
10 |
|
11 |
prompt = st.chat_input("Say something")
|
12 |
if prompt:
|