Spaces:
Running
on
L4
Running
on
L4
Update app.py
Browse files
app.py
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
import gradio as gr
|
4 |
import os
|
5 |
-
|
6 |
import torch
|
7 |
import torch.nn.functional as F
|
8 |
from peft import PeftConfig, PeftModel
|
@@ -27,7 +27,7 @@ model.merge_and_unload()
|
|
27 |
model = model.to(device)
|
28 |
|
29 |
tokenizer = AutoTokenizer.from_pretrained(base_model_name)
|
30 |
-
|
31 |
PROMPT = """
|
32 |
INSTRUCTIONS
|
33 |
============
|
@@ -120,7 +120,7 @@ def predict(content, policy):
|
|
120 |
|
121 |
|
122 |
# Create the interface
|
123 |
-
with gr.Blocks(
|
124 |
with gr.Row():
|
125 |
# Left column with inputs
|
126 |
with gr.Column(scale=1):
|
@@ -167,7 +167,8 @@ with gr.Blocks(api_name=False) as demo:
|
|
167 |
submit_btn.click(
|
168 |
fn=predict,
|
169 |
inputs=[input1, input2],
|
170 |
-
outputs=output
|
|
|
171 |
)
|
172 |
|
173 |
# Launch the interface
|
|
|
2 |
|
3 |
import gradio as gr
|
4 |
import os
|
5 |
+
"""
|
6 |
import torch
|
7 |
import torch.nn.functional as F
|
8 |
from peft import PeftConfig, PeftModel
|
|
|
27 |
model = model.to(device)
|
28 |
|
29 |
tokenizer = AutoTokenizer.from_pretrained(base_model_name)
|
30 |
+
"""
|
31 |
PROMPT = """
|
32 |
INSTRUCTIONS
|
33 |
============
|
|
|
120 |
|
121 |
|
122 |
# Create the interface
|
123 |
+
with gr.Blocks() as demo:
|
124 |
with gr.Row():
|
125 |
# Left column with inputs
|
126 |
with gr.Column(scale=1):
|
|
|
167 |
submit_btn.click(
|
168 |
fn=predict,
|
169 |
inputs=[input1, input2],
|
170 |
+
outputs=output,
|
171 |
+
api_name=False
|
172 |
)
|
173 |
|
174 |
# Launch the interface
|