Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -3,6 +3,8 @@ import streamlit as st
|
|
3 |
|
4 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
5 |
|
|
|
|
|
6 |
checkpoint = "."
|
7 |
|
8 |
tokenizer = AutoTokenizer.from_pretrained(checkpoint)
|
@@ -14,6 +16,7 @@ def load_model(model_name):
|
|
14 |
|
15 |
model = load_model(checkpoint)
|
16 |
|
|
|
17 |
def infer(input_ids, bad_words_ids, max_tokens, temperature, top_k, top_p):
|
18 |
|
19 |
output_sequences = model.generate(
|
|
|
3 |
|
4 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
5 |
|
6 |
+
import spaces
|
7 |
+
|
8 |
checkpoint = "."
|
9 |
|
10 |
tokenizer = AutoTokenizer.from_pretrained(checkpoint)
|
|
|
16 |
|
17 |
model = load_model(checkpoint)
|
18 |
|
19 |
+
@spaces.GPU
|
20 |
def infer(input_ids, bad_words_ids, max_tokens, temperature, top_k, top_p):
|
21 |
|
22 |
output_sequences = model.generate(
|