Spaces:
Runtime error
Runtime error
Danil
commited on
Commit
Β·
0bea55f
1
Parent(s):
7c0ff8b
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
import streamlit as st
|
2 |
-
from transformers import
|
3 |
|
4 |
@st.cache(allow_output_mutation=True)
|
5 |
def load_model():
|
@@ -7,9 +7,9 @@ def load_model():
|
|
7 |
Loads the model and tokenizer from the local directory.
|
8 |
:return: A list containing the model and the tokenizer.
|
9 |
'''
|
10 |
-
model_name = '
|
11 |
-
tokenizer =
|
12 |
-
model =
|
13 |
return [model, tokenizer]
|
14 |
|
15 |
st.set_page_config(
|
|
|
1 |
import streamlit as st
|
2 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
3 |
|
4 |
@st.cache(allow_output_mutation=True)
|
5 |
def load_model():
|
|
|
7 |
Loads the model and tokenizer from the local directory.
|
8 |
:return: A list containing the model and the tokenizer.
|
9 |
'''
|
10 |
+
model_name = 'facebook/incoder-6B'
|
11 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
12 |
+
model = AutoModelForCausalLM.from_pretrained(model_name, low_cpu_mem_usage=True)
|
13 |
return [model, tokenizer]
|
14 |
|
15 |
st.set_page_config(
|