Spaces:
Running
Running
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
3 |
+
|
4 |
+
model_name = "deepseek-ai/DeepSeek-V3-Base"
|
5 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
6 |
+
model = AutoModelForCausalLM.from_pretrained(model_name)
|
7 |
+
|
8 |
+
st.title("DeepSeek Chatbot")
|
9 |
+
|
10 |
+
prompt = st.text_input("Enter your message:")
|
11 |
+
|
12 |
+
if prompt:
|
13 |
+
inputs = tokenizer.encode(prompt, return_tensors="pt")
|
14 |
+
outputs = model.generate(inputs)
|
15 |
+
response = tokenizer.decode(outputs[0])
|
16 |
+
st.write(response)
|