Spaces:
Sleeping
Sleeping
Commit
·
06f5664
1
Parent(s):
24b4b92
deploy
Browse files- app/main.py +2 -17
- app/templates/email_input.html +2 -2
app/main.py
CHANGED
@@ -54,26 +54,11 @@ async def create_upload_files(request: Request , paragraphInput: str = Form(...)
|
|
54 |
global email_inp
|
55 |
print("hi im in subject gen", paragraphInput )
|
56 |
print("########################",request)
|
57 |
-
|
58 |
-
print('********************',input_email)
|
59 |
-
if 'text' in input_email.content_type:
|
60 |
-
contents = await input_email.read()
|
61 |
-
|
62 |
-
email_inp = 'app/static/' + input_email.filename
|
63 |
-
|
64 |
-
# Save the contents to the text file
|
65 |
-
with open(email_inp, 'w', encoding='utf-8') as f:
|
66 |
-
f.write(contents.decode('utf-8'))
|
67 |
-
print('********************',email_inp)
|
68 |
-
email = ""
|
69 |
-
with open(email_inp, 'r', encoding='utf-8') as f:
|
70 |
-
email =f.read()
|
71 |
-
result = subject_gen.subject_gen_func(email)
|
72 |
print(result)
|
73 |
-
|
74 |
return templates.TemplateResponse("subject_generation.html", {"request": request,
|
75 |
"result":result,
|
76 |
-
"email":
|
77 |
|
78 |
|
79 |
# Set all CORS enabled origins
|
|
|
54 |
global email_inp
|
55 |
print("hi im in subject gen", paragraphInput )
|
56 |
print("########################",request)
|
57 |
+
result = subject_gen.subject_gen_func( paragraphInput)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
print(result)
|
|
|
59 |
return templates.TemplateResponse("subject_generation.html", {"request": request,
|
60 |
"result":result,
|
61 |
+
"email": paragraphInput,})
|
62 |
|
63 |
|
64 |
# Set all CORS enabled origins
|
app/templates/email_input.html
CHANGED
@@ -12,7 +12,7 @@
|
|
12 |
<div>
|
13 |
<fieldset>
|
14 |
<ul>
|
15 |
-
|
16 |
<br>
|
17 |
<form action="/subject_generation/" enctype="multipart/form-data" method="post">
|
18 |
<span style="font-weight:bold;font-family:sans-serif">Enter Email:</span> <br><br>
|
@@ -20,7 +20,7 @@
|
|
20 |
<br><br><br><br>
|
21 |
<button type="submit">Generate Subject</button>
|
22 |
</form>
|
23 |
-
|
24 |
<br><br>
|
25 |
<form action="/" method="get">
|
26 |
<button type="submit">Home</button>
|
|
|
12 |
<div>
|
13 |
<fieldset>
|
14 |
<ul>
|
15 |
+
<li>
|
16 |
<br>
|
17 |
<form action="/subject_generation/" enctype="multipart/form-data" method="post">
|
18 |
<span style="font-weight:bold;font-family:sans-serif">Enter Email:</span> <br><br>
|
|
|
20 |
<br><br><br><br>
|
21 |
<button type="submit">Generate Subject</button>
|
22 |
</form>
|
23 |
+
</li>
|
24 |
<br><br>
|
25 |
<form action="/" method="get">
|
26 |
<button type="submit">Home</button>
|