Spaces:
Sleeping
Sleeping
GeorgeSherif
commited on
Commit
·
e727153
1
Parent(s):
965aed3
updates
Browse files
app.py
CHANGED
|
@@ -3,8 +3,12 @@ import os
|
|
| 3 |
import threading
|
| 4 |
import random
|
| 5 |
from datasets import load_dataset, Dataset, Features, Value
|
| 6 |
-
|
| 7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
dataset_name = "GeorgeIbrahim/EGYCOCO" # Replace with your dataset name
|
| 9 |
|
| 10 |
# Load or create the dataset
|
|
@@ -108,4 +112,4 @@ with gr.Blocks() as demo:
|
|
| 108 |
# Load initial image
|
| 109 |
demo.load(fn=initialize_interface, inputs=None, outputs=[image, caption])
|
| 110 |
|
| 111 |
-
demo.launch(share=True)
|
|
|
|
| 3 |
import threading
|
| 4 |
import random
|
| 5 |
from datasets import load_dataset, Dataset, Features, Value
|
| 6 |
+
from huggingface_hub import login
|
| 7 |
+
token = os.getenv("HUGGINGFACE_TOKEN")
|
| 8 |
+
if token:
|
| 9 |
+
login(token=token)
|
| 10 |
+
else:
|
| 11 |
+
print("HUGGINGFACE_TOKEN environment variable not set.")
|
| 12 |
dataset_name = "GeorgeIbrahim/EGYCOCO" # Replace with your dataset name
|
| 13 |
|
| 14 |
# Load or create the dataset
|
|
|
|
| 112 |
# Load initial image
|
| 113 |
demo.load(fn=initialize_interface, inputs=None, outputs=[image, caption])
|
| 114 |
|
| 115 |
+
demo.launch(share=True)
|