Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -2,6 +2,13 @@ import gradio as gr
|
|
2 |
import tensorflow as tf
|
3 |
import numpy as np
|
4 |
import pickle
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
# Load model, including its weights and the optimizer
|
6 |
model = tf.keras.models.load_model('core4.h5')
|
7 |
# load tokenizer
|
@@ -17,8 +24,7 @@ def greet(string):
|
|
17 |
print("Predicted label: " + predicted_label + "\n")
|
18 |
|
19 |
###################
|
20 |
-
|
21 |
-
import pandas as pd
|
22 |
|
23 |
spreadsheet_id = '1vjWnYsnGc0J6snT67NVbA-NWSGZ5b0eDBVHmg9lbf9s' # Please set the Spreadsheet ID.
|
24 |
csv_url='https://docs.google.com/spreadsheets/d/' + spreadsheet_id + '/export?format=csv&id=' + spreadsheet_id + '&gid=0'
|
@@ -27,8 +33,7 @@ def greet(string):
|
|
27 |
open('google.csv', 'wb').write(res.content)
|
28 |
df = pd.read_csv('google.csv')
|
29 |
|
30 |
-
|
31 |
-
import requests
|
32 |
|
33 |
spreadsheet_id = '1vjWnYsnGc0J6snT67NVbA-NWSGZ5b0eDBVHmg9lbf9s' # Please set the Spreadsheet ID.
|
34 |
url = 'https://script.google.com/macros/s/AKfycbwXP5fsDgOXJ9biZQC293o6bTBL3kDOJ07PlmxKjabzdTej6WYdC8Yos6NpDVqAJeVM/exec?spreadsheetId=' + spreadsheet_id
|
@@ -44,7 +49,7 @@ def greet(string):
|
|
44 |
}
|
45 |
res = requests.post(url, json.dumps(body), headers={'Content-Type': 'application/json'})
|
46 |
|
47 |
-
|
48 |
current_time = datetime.datetime.now()
|
49 |
body = {
|
50 |
"arguments": {"range": "Sheet1!D"+str(len(df)+2), "valueInputOption": "USER_ENTERED"},
|
|
|
2 |
import tensorflow as tf
|
3 |
import numpy as np
|
4 |
import pickle
|
5 |
+
import requests as rs
|
6 |
+
import pandas as pd
|
7 |
+
import json
|
8 |
+
import requests
|
9 |
+
import datetime
|
10 |
+
|
11 |
+
|
12 |
# Load model, including its weights and the optimizer
|
13 |
model = tf.keras.models.load_model('core4.h5')
|
14 |
# load tokenizer
|
|
|
24 |
print("Predicted label: " + predicted_label + "\n")
|
25 |
|
26 |
###################
|
27 |
+
|
|
|
28 |
|
29 |
spreadsheet_id = '1vjWnYsnGc0J6snT67NVbA-NWSGZ5b0eDBVHmg9lbf9s' # Please set the Spreadsheet ID.
|
30 |
csv_url='https://docs.google.com/spreadsheets/d/' + spreadsheet_id + '/export?format=csv&id=' + spreadsheet_id + '&gid=0'
|
|
|
33 |
open('google.csv', 'wb').write(res.content)
|
34 |
df = pd.read_csv('google.csv')
|
35 |
|
36 |
+
|
|
|
37 |
|
38 |
spreadsheet_id = '1vjWnYsnGc0J6snT67NVbA-NWSGZ5b0eDBVHmg9lbf9s' # Please set the Spreadsheet ID.
|
39 |
url = 'https://script.google.com/macros/s/AKfycbwXP5fsDgOXJ9biZQC293o6bTBL3kDOJ07PlmxKjabzdTej6WYdC8Yos6NpDVqAJeVM/exec?spreadsheetId=' + spreadsheet_id
|
|
|
49 |
}
|
50 |
res = requests.post(url, json.dumps(body), headers={'Content-Type': 'application/json'})
|
51 |
|
52 |
+
|
53 |
current_time = datetime.datetime.now()
|
54 |
body = {
|
55 |
"arguments": {"range": "Sheet1!D"+str(len(df)+2), "valueInputOption": "USER_ENTERED"},
|