Spaces:
Runtime error
Runtime error
shivam9980
commited on
Commit
•
af409a2
1
Parent(s):
34ac9f8
Update app.py
Browse files
app.py
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
# Load model directly
|
2 |
import streamlit as st
|
3 |
from unsloth import FastLanguageModel
|
@@ -9,6 +10,7 @@ model, tokenizer = FastLanguageModel.from_pretrained(
|
|
9 |
load_in_4bit = True,
|
10 |
token = hf_token, # use one if using gated models like meta-llama/Llama-2-7b-hf
|
11 |
)
|
|
|
12 |
|
13 |
# alpaca_prompt = You MUST copy from above!
|
14 |
|
@@ -22,6 +24,7 @@ alpaca_prompt = """Below is an instruction that describes a task, paired with an
|
|
22 |
### Response:
|
23 |
{}"""
|
24 |
|
|
|
25 |
# alpaca_prompt = Copied from above
|
26 |
c = st.text_input('Enter the contents ')
|
27 |
FastLanguageModel.for_inference(model) # Enable native 2x faster inference
|
|
|
1 |
+
+import spaces
|
2 |
# Load model directly
|
3 |
import streamlit as st
|
4 |
from unsloth import FastLanguageModel
|
|
|
10 |
load_in_4bit = True,
|
11 |
token = hf_token, # use one if using gated models like meta-llama/Llama-2-7b-hf
|
12 |
)
|
13 |
+
model.to('cuda')
|
14 |
|
15 |
# alpaca_prompt = You MUST copy from above!
|
16 |
|
|
|
24 |
### Response:
|
25 |
{}"""
|
26 |
|
27 |
+
+@spaces.GPU
|
28 |
# alpaca_prompt = Copied from above
|
29 |
c = st.text_input('Enter the contents ')
|
30 |
FastLanguageModel.for_inference(model) # Enable native 2x faster inference
|