disk0dancer commited on
Commit
a36827f
·
verified ·
1 Parent(s): 9a889c4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -11,7 +11,12 @@ AUTH_TOKEN = os.getenv("AUTH_TOKEN")
11
  headers = {"Authorization": f"Bearer {AUTH_TOKEN}"}
12
 
13
  def postproccess(responce):
14
- return ' '.join(x['entity_group'] for x in responce)
 
 
 
 
 
15
 
16
  def query(request):
17
  response = requests.post(API_URL, headers=headers, json=request)
@@ -27,6 +32,7 @@ with gr.Blocks() as demo:
27
 
28
  - [Модель](https://huggingface.co/disk0dancer/ruBert-base-finetuned-pos)
29
  - [Проект](https://huggingface.co/spaces/disk0dancer/demo-rubert-base-finetuned-pos)
 
30
 
31
  """)
32
  inp = gr.Textbox(placeholder="Введите текст на русском языке...", label="input")
 
11
  headers = {"Authorization": f"Bearer {AUTH_TOKEN}"}
12
 
13
  def postproccess(responce):
14
+ try:
15
+ return ' '.join(x['entity_group'] for x in responce)
16
+ except Exception as ex:
17
+ print(x.__dict__)
18
+ print(f"Exception: {ex}")
19
+ return f"Exception: {ex}"
20
 
21
  def query(request):
22
  response = requests.post(API_URL, headers=headers, json=request)
 
32
 
33
  - [Модель](https://huggingface.co/disk0dancer/ruBert-base-finetuned-pos)
34
  - [Проект](https://huggingface.co/spaces/disk0dancer/demo-rubert-base-finetuned-pos)
35
+ - [Код и Документация](https://github.com/disk0Dancer/rubert-finetuned-pos)
36
 
37
  """)
38
  inp = gr.Textbox(placeholder="Введите текст на русском языке...", label="input")