Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
62ede92
1
Parent(s):
e60d22c
Add @spaces.GPU decorator for GPU-enabled Space
Browse files
app.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
import gradio as gr
|
2 |
import torch
|
3 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
|
|
4 |
|
5 |
# Model configuration
|
6 |
MODEL_ID = "yasserrmd/DentaInstruct-1.2B"
|
@@ -65,6 +66,7 @@ def format_prompt(message, history):
|
|
65 |
|
66 |
return prompt
|
67 |
|
|
|
68 |
def generate_response(
|
69 |
message,
|
70 |
history,
|
|
|
1 |
import gradio as gr
|
2 |
import torch
|
3 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
4 |
+
import spaces
|
5 |
|
6 |
# Model configuration
|
7 |
MODEL_ID = "yasserrmd/DentaInstruct-1.2B"
|
|
|
66 |
|
67 |
return prompt
|
68 |
|
69 |
+
@spaces.GPU(duration=60)
|
70 |
def generate_response(
|
71 |
message,
|
72 |
history,
|