Update app.py
Browse files
app.py
CHANGED
|
@@ -5,12 +5,11 @@
|
|
| 5 |
import pandas as pd
|
| 6 |
from openai import OpenAI
|
| 7 |
import json
|
|
|
|
| 8 |
|
| 9 |
|
| 10 |
-
|
| 11 |
-
|
| 12 |
def process_article(text, local_input, solidarity_input,issue_input,policy_input):
|
| 13 |
-
|
| 14 |
categories = {
|
| 15 |
"$schema": "http://json-schema.org/draft-07/schema#",
|
| 16 |
"title": "Protest Information",
|
|
|
|
| 5 |
import pandas as pd
|
| 6 |
from openai import OpenAI
|
| 7 |
import json
|
| 8 |
+
from tenacity import retry, wait_random_exponential, stop_after_attempt
|
| 9 |
|
| 10 |
|
| 11 |
+
@retry(wait=wait_random_exponential(min=1, max=3), stop=stop_after_attempt(2))
|
|
|
|
| 12 |
def process_article(text, local_input, solidarity_input,issue_input,policy_input):
|
|
|
|
| 13 |
categories = {
|
| 14 |
"$schema": "http://json-schema.org/draft-07/schema#",
|
| 15 |
"title": "Protest Information",
|