Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -15,6 +15,9 @@ from huggingface_hub import login
|
|
| 15 |
# from prompt_augment import PromptAugment
|
| 16 |
hf_token = os.getenv("hf")
|
| 17 |
|
|
|
|
|
|
|
|
|
|
| 18 |
if hf_token:
|
| 19 |
print("Secret loaded successfully.")
|
| 20 |
else:
|
|
@@ -124,6 +127,7 @@ ADAPTER_SPECS = {
|
|
| 124 |
|
| 125 |
LOADED_ADAPTERS = set()
|
| 126 |
LORA_OPTIONS = ["None"] + list(LORA_CONFIGS.keys()) + ["Lightning"]
|
|
|
|
| 127 |
|
| 128 |
|
| 129 |
def load_lora(lora_name):
|
|
@@ -405,5 +409,5 @@ with gr.Blocks() as demo:
|
|
| 405 |
|
| 406 |
if __name__ == "__main__":
|
| 407 |
demo.queue()
|
| 408 |
-
demo.launch(allowed_paths=["./"], ssr_mode=False, css=css)
|
| 409 |
|
|
|
|
| 15 |
# from prompt_augment import PromptAugment
|
| 16 |
hf_token = os.getenv("hf")
|
| 17 |
|
| 18 |
+
space_id = os.getenv("SPACE_ID")
|
| 19 |
+
root_path = f"https://{space_id.replace('/', '-')}.hf.space" if space_id else ""
|
| 20 |
+
|
| 21 |
if hf_token:
|
| 22 |
print("Secret loaded successfully.")
|
| 23 |
else:
|
|
|
|
| 127 |
|
| 128 |
LOADED_ADAPTERS = set()
|
| 129 |
LORA_OPTIONS = ["None"] + list(LORA_CONFIGS.keys()) + ["Lightning"]
|
| 130 |
+
print("lora option: {LORA_OPTIONS[0]}")
|
| 131 |
|
| 132 |
|
| 133 |
def load_lora(lora_name):
|
|
|
|
| 409 |
|
| 410 |
if __name__ == "__main__":
|
| 411 |
demo.queue()
|
| 412 |
+
demo.launch(allowed_paths=["./"], ssr_mode=False, css=css, root_path=root_path)
|
| 413 |
|