Update app.py
Browse files
app.py
CHANGED
@@ -1,10 +1,6 @@
|
|
1 |
import torch
|
2 |
from peft import PeftModel, PeftConfig
|
3 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
4 |
-
import gradio as gr
|
5 |
-
|
6 |
-
# Import the specific Gradio components
|
7 |
-
from gradio import Textbox, Interface
|
8 |
|
9 |
peft_model_id = f"alimrb/eff24"
|
10 |
config = PeftConfig.from_pretrained(peft_model_id)
|
@@ -31,11 +27,13 @@ def make_inference(product_name, product_description):
|
|
31 |
|
32 |
if __name__ == "__main__":
|
33 |
# Create a Gradio interface
|
34 |
-
|
|
|
|
|
35 |
make_inference,
|
36 |
[
|
37 |
-
Textbox(lines=2, label="Product Name"),
|
38 |
-
Textbox(lines=5, label="Product Description"),
|
39 |
],
|
40 |
Textbox(label="Ad"),
|
41 |
title="EFF24",
|
|
|
1 |
import torch
|
2 |
from peft import PeftModel, PeftConfig
|
3 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
|
|
|
|
|
|
|
|
4 |
|
5 |
peft_model_id = f"alimrb/eff24"
|
6 |
config = PeftConfig.from_pretrained(peft_model_id)
|
|
|
27 |
|
28 |
if __name__ == "__main__":
|
29 |
# Create a Gradio interface
|
30 |
+
import gradio as gr
|
31 |
+
|
32 |
+
gr.Interface(
|
33 |
make_inference,
|
34 |
[
|
35 |
+
gr.Textbox(lines=2, label="Product Name"),
|
36 |
+
gr.Textbox(lines=5, label="Product Description"),
|
37 |
],
|
38 |
Textbox(label="Ad"),
|
39 |
title="EFF24",
|