Spaces:
Runtime error
Runtime error
56
Browse files
app.py
CHANGED
|
@@ -12,6 +12,21 @@ wb = None
|
|
| 12 |
def greet(name):
|
| 13 |
return "Hello " + name + "!!"
|
| 14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
# Create the Gradio interface
|
| 16 |
with gr.Blocks() as demo:
|
| 17 |
with gr.Row():
|
|
|
|
| 12 |
def greet(name):
|
| 13 |
return "Hello " + name + "!!"
|
| 14 |
|
| 15 |
+
# Load the Excel file from Github
|
| 16 |
+
def load_excel_from_github():
|
| 17 |
+
global df, wb
|
| 18 |
+
url = "https://github.com/mmlanla/image_share/blob/main/mass_update_sales_info_lastest.xlsx?raw=true"
|
| 19 |
+
response = requests.get(url)
|
| 20 |
+
file_data = BytesIO(response.content)
|
| 21 |
+
wb = load_workbook(file_data)
|
| 22 |
+
sheet = wb.active
|
| 23 |
+
df = pd.DataFrame(sheet.values)
|
| 24 |
+
df.columns = df.iloc[0] # Set the first row as column names
|
| 25 |
+
df = df[1:] # Remove the first row from the DataFrame
|
| 26 |
+
options = df['et_title_variation_name'].unique().tolist()
|
| 27 |
+
print('options', options)
|
| 28 |
+
return options
|
| 29 |
+
|
| 30 |
# Create the Gradio interface
|
| 31 |
with gr.Blocks() as demo:
|
| 32 |
with gr.Row():
|