Spaces:
Running
on
Zero
Running
on
Zero
feat: change nanochat model to our German one
Browse files
app.py
CHANGED
|
@@ -7,7 +7,7 @@ from transformers import AutoModelForCausalLM, AutoTokenizer
|
|
| 7 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 8 |
|
| 9 |
def load_model():
|
| 10 |
-
model_id = "
|
| 11 |
|
| 12 |
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=False)
|
| 13 |
model = AutoModelForCausalLM.from_pretrained(model_id, trust_remote_code=False, dtype=torch.bfloat16).to(device)
|
|
@@ -51,5 +51,5 @@ def generate(prompt, history):
|
|
| 51 |
return output
|
| 52 |
|
| 53 |
|
| 54 |
-
demo = gr.ChatInterface(fn=generate, type="messages", examples=["
|
| 55 |
demo.launch()
|
|
|
|
| 7 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 8 |
|
| 9 |
def load_model():
|
| 10 |
+
model_id = "stefan-it/nanochat-german-v1"
|
| 11 |
|
| 12 |
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=False)
|
| 13 |
model = AutoModelForCausalLM.from_pretrained(model_id, trust_remote_code=False, dtype=torch.bfloat16).to(device)
|
|
|
|
| 51 |
return output
|
| 52 |
|
| 53 |
|
| 54 |
+
demo = gr.ChatInterface(fn=generate, type="messages", examples=["Hallo", "Servus", "Hi"], title="nanochat German v1")
|
| 55 |
demo.launch()
|