Spaces:
Running
Running
Rename app_test.py to app.py
Browse files- app_test.py → app.py +11 -2
app_test.py → app.py
RENAMED
@@ -1,10 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
def casa_ai_run(image=None, text=None):
|
2 |
|
3 |
if image is None and text is None:
|
4 |
print('Please provide context in form of image, audio, text')
|
5 |
return None
|
6 |
|
7 |
-
result_image =
|
8 |
return result_image
|
9 |
|
10 |
import gradio as gr
|
@@ -22,4 +30,5 @@ demo = gr.Interface(casa_ai_run,
|
|
22 |
title = title,
|
23 |
description = description,
|
24 |
)
|
25 |
-
demo.launch()
|
|
|
|
1 |
+
import os
|
2 |
+
import modal
|
3 |
+
|
4 |
+
os.environ["MODAL_TOKEN_ID"] = modal_token_id_hf
|
5 |
+
os.environ["MODAL_TOKEN_SECRET"] = modal_token_secret_hf
|
6 |
+
|
7 |
+
f = modal.Cls.lookup("casa-interior-hf-v1", "DesignModel")
|
8 |
+
|
9 |
def casa_ai_run(image=None, text=None):
|
10 |
|
11 |
if image is None and text is None:
|
12 |
print('Please provide context in form of image, audio, text')
|
13 |
return None
|
14 |
|
15 |
+
result_image = f.inference.remote(image, prompt)
|
16 |
return result_image
|
17 |
|
18 |
import gradio as gr
|
|
|
30 |
title = title,
|
31 |
description = description,
|
32 |
)
|
33 |
+
demo.launch()
|
34 |
+
|