Spaces:
Runtime error
Runtime error
samarpitminz
commited on
Commit
•
278cdf2
1
Parent(s):
f10cac7
less gooo
Browse files
app.py
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
|
3 |
+
def greet(Batch, file):
|
4 |
+
import re
|
5 |
+
# with open(file, encoding = 'utf-8') as f:
|
6 |
+
placed = set()
|
7 |
+
print(file)
|
8 |
+
file.seek(0)
|
9 |
+
cont = file.read()
|
10 |
+
print(cont)
|
11 |
+
chat = re.split('../../.., *', cont.decode('utf-8'))
|
12 |
+
for msg in chat:
|
13 |
+
if 'acceptance' in msg:
|
14 |
+
print(re.findall(': (.)FTE',msg), sorted(re.findall('(?i)2k19/co/[0-9]',msg)))
|
15 |
+
placed.update(re.findall(f'(?i){Batch}/[0-9]*', msg))
|
16 |
+
return str(len(placed))
|
17 |
+
|
18 |
+
demo = gr.Interface(fn=greet, inputs=["text", "file"], outputs="text")
|
19 |
+
demo.launch()
|