Update app.py
Browse files
app.py
CHANGED
@@ -1,10 +1,12 @@
|
|
1 |
import gradio as gr
|
2 |
-
|
|
|
3 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
4 |
|
5 |
tokenizer = AutoTokenizer.from_pretrained("ping98k/typhoon-7b-rag-instruct-th")
|
6 |
model = AutoModelForCausalLM.from_pretrained("ping98k/typhoon-7b-rag-instruct-th")
|
7 |
|
|
|
8 |
def response(instruction, history, inputText):
|
9 |
inp = f"""### Instruction:
|
10 |
{instruction}
|
|
|
1 |
import gradio as gr
|
2 |
+
import torch
|
3 |
+
import spaces
|
4 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
5 |
|
6 |
tokenizer = AutoTokenizer.from_pretrained("ping98k/typhoon-7b-rag-instruct-th")
|
7 |
model = AutoModelForCausalLM.from_pretrained("ping98k/typhoon-7b-rag-instruct-th")
|
8 |
|
9 |
+
@spaces.GPU(duration=120)
|
10 |
def response(instruction, history, inputText):
|
11 |
inp = f"""### Instruction:
|
12 |
{instruction}
|