Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,27 @@
|
|
|
|
1 |
import gradio as gr
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
from transformers import pipeline
|
3 |
from fpdf import FPDF
|
4 |
import tempfile
|
@@ -70,3 +93,4 @@ iface = gr.Interface(
|
|
70 |
)
|
71 |
|
72 |
iface.launch()
|
|
|
|
1 |
+
from transformers import pipeline
|
2 |
import gradio as gr
|
3 |
+
|
4 |
+
generator = pipeline("text-generation", model="sshleifer/tiny-gpt2")
|
5 |
+
|
6 |
+
def generate_proposal(client_description):
|
7 |
+
generated = generator(client_description, max_length=100, do_sample=True, temperature=0.7)
|
8 |
+
return generated[0]["generated_text"]
|
9 |
+
|
10 |
+
iface = gr.Interface(
|
11 |
+
fn=generate_proposal,
|
12 |
+
inputs=gr.Textbox(label="Client Requirement"),
|
13 |
+
outputs=gr.Textbox(label="Generated Proposal"),
|
14 |
+
title="Fast Proposal Generator",
|
15 |
+
description="Lightweight and fast text generator using TinyGPT2"
|
16 |
+
)
|
17 |
+
|
18 |
+
iface.launch()
|
19 |
+
|
20 |
+
|
21 |
+
#______________________________________________________________________________________________________________________________________
|
22 |
+
|
23 |
+
|
24 |
+
'''import gradio as gr
|
25 |
from transformers import pipeline
|
26 |
from fpdf import FPDF
|
27 |
import tempfile
|
|
|
93 |
)
|
94 |
|
95 |
iface.launch()
|
96 |
+
'''
|