Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,15 +1,15 @@
|
|
1 |
import gradio as gr
|
2 |
-
from llama_cpp import Llama
|
3 |
-
|
4 |
# Load the model
|
5 |
-
llm =
|
6 |
repo_id="Viet-Mistral/Vistral-7B-Chat"
|
7 |
# filename="models-7B-F16.gguf"
|
8 |
)
|
9 |
|
10 |
# Define the function to interact with the model
|
11 |
def chat_with_model(user_input):
|
12 |
-
response = llm.
|
13 |
messages=[
|
14 |
{"role": "user", "content": user_input}
|
15 |
]
|
|
|
1 |
import gradio as gr
|
2 |
+
#from llama_cpp import Llama
|
3 |
+
from transformers import AutoModelForCausalLM
|
4 |
# Load the model
|
5 |
+
llm = AutoModelForCausalLM.from_pretrained(
|
6 |
repo_id="Viet-Mistral/Vistral-7B-Chat"
|
7 |
# filename="models-7B-F16.gguf"
|
8 |
)
|
9 |
|
10 |
# Define the function to interact with the model
|
11 |
def chat_with_model(user_input):
|
12 |
+
response = llm.generate(
|
13 |
messages=[
|
14 |
{"role": "user", "content": user_input}
|
15 |
]
|