Spaces:
Sleeping
Sleeping
Nikhil Singh
commited on
Commit
·
2fe2a42
1
Parent(s):
8efe659
updating app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,25 @@
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
def greet(name):
|
4 |
-
|
|
|
5 |
|
6 |
demo = gr.Interface(fn=greet, inputs="text", outputs="text")
|
7 |
demo.launch()
|
|
|
1 |
+
import os
|
2 |
+
|
3 |
import gradio as gr
|
4 |
|
5 |
+
from gliner import GLiNER
|
6 |
+
from typing import Dict, Union, List
|
7 |
+
from mailparser import parse_from_string
|
8 |
+
|
9 |
+
def receive_mail(name):
|
10 |
+
email = parse_from_string(name)
|
11 |
+
# print("Subject:", )
|
12 |
+
# print("From:", email.from_)
|
13 |
+
# print("To:", email.to)
|
14 |
+
# print("Date:", email.date)
|
15 |
+
# print("Message ID:", email.message_id)
|
16 |
+
# print("Headers:", email.headers)
|
17 |
+
# print("Attachments:", email.attachments)
|
18 |
+
return email.subject
|
19 |
+
|
20 |
def greet(name):
|
21 |
+
email_subject = receive_mail(name)
|
22 |
+
return email_subject
|
23 |
|
24 |
demo = gr.Interface(fn=greet, inputs="text", outputs="text")
|
25 |
demo.launch()
|