Spaces:
Runtime error
Runtime error
shivam9980
commited on
Commit
•
212a785
1
Parent(s):
a299a1e
Update app.py
Browse files
app.py
CHANGED
@@ -1,9 +1,17 @@
|
|
1 |
# Load model directly
|
2 |
import streamlit as st
|
3 |
-
from transformers import AutoModel
|
4 |
-
model,tokenizer = AutoModel.from_pretrained("shivam9980/mistral-7b-news")
|
5 |
-
alpaca_prompt = """Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
|
6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
### Instruction:
|
8 |
{}
|
9 |
|
|
|
1 |
# Load model directly
|
2 |
import streamlit as st
|
|
|
|
|
|
|
3 |
|
4 |
+
from unsloth import FastLanguageModel
|
5 |
+
model, tokenizer = FastLanguageModel.from_pretrained(
|
6 |
+
model_name = "shivam9980/mistral-7b-news", # YOUR MODEL YOU USED FOR TRAINING
|
7 |
+
max_seq_length = 2048,
|
8 |
+
dtype = None,
|
9 |
+
load_in_4bit = True,)
|
10 |
+
FastLanguageModel.for_inference(model) # Enable native 2x faster inference
|
11 |
+
|
12 |
+
# alpaca_prompt = You MUST copy from above!
|
13 |
+
|
14 |
+
alpaca_prompt = """Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
|
15 |
### Instruction:
|
16 |
{}
|
17 |
|