Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -15,10 +15,7 @@ def generate_preds(desc):
|
|
15 |
# input_desc = "GENERATE TRIGGER AND ACTION CHANNEL ONLY <pf> " + input_desc
|
16 |
# elif gen_mode=="Function":
|
17 |
# input_desc = "GENERATE BOTH CHANNEL AND FUNCTION FOR TRIGGER AND ACTION <pf> " + input_desc
|
18 |
-
|
19 |
-
model = EncoderDecoderModel.from_pretrained("imamnurby/rob2rand_chen_w_prefix_c_fc")
|
20 |
-
tokenizer = RobertaTokenizer.from_pretrained("imamnurby/rob2rand_chen_w_prefix_c_fc")
|
21 |
-
|
22 |
input_ids = tokenizer.encode(desc, return_tensors='pt')
|
23 |
|
24 |
# activate beam search and early_stopping
|
@@ -69,17 +66,17 @@ with demo:
|
|
69 |
5. Click **Generate**; the generated TAPs along with the description of each component will show in the **Results**
|
70 |
""")
|
71 |
gr.Markdown("NOTE: **#Returned Sequences** should be LESS THAN OR EQUAL **Beam Width**")
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
|
84 |
# with gr.TabItem("Field"):
|
85 |
# with gr.Column():
|
|
|
15 |
# input_desc = "GENERATE TRIGGER AND ACTION CHANNEL ONLY <pf> " + input_desc
|
16 |
# elif gen_mode=="Function":
|
17 |
# input_desc = "GENERATE BOTH CHANNEL AND FUNCTION FOR TRIGGER AND ACTION <pf> " + input_desc
|
18 |
+
|
|
|
|
|
|
|
19 |
input_ids = tokenizer.encode(desc, return_tensors='pt')
|
20 |
|
21 |
# activate beam search and early_stopping
|
|
|
66 |
5. Click **Generate**; the generated TAPs along with the description of each component will show in the **Results**
|
67 |
""")
|
68 |
gr.Markdown("NOTE: **#Returned Sequences** should be LESS THAN OR EQUAL **Beam Width**")
|
69 |
+
with gr.Tabs():
|
70 |
+
with gr.TabItem("Channel/Function"):
|
71 |
+
with gr.Column():
|
72 |
+
# gen_mode = gr.Radio(label="Granularity", choices=["Channel", "Function"])
|
73 |
+
desc = gr.Textbox(label="Functionality Description", placeholder="Describe the functionality here")
|
74 |
+
# num_beams = gr.Slider(minimum=2, maximum=500, value=2, step=1, label="Beam Width")
|
75 |
+
# num_returned_seqs = gr.Slider(minimum=2, maximum=500, value=2, step=1, label="#Returned Sequences")
|
76 |
+
# with gr.Row():
|
77 |
+
generate = gr.Button("Generate")
|
78 |
+
# gr.Markdown("<h1><center>Results</center></h1>")
|
79 |
+
results = gr.Dataframe(headers=["Trigger", "Trigger Description", "Action", "Action Description"])
|
80 |
|
81 |
# with gr.TabItem("Field"):
|
82 |
# with gr.Column():
|