Spaces:
Runtime error
Runtime error
change lora and add oauth button
Browse files
app.py
CHANGED
@@ -29,7 +29,7 @@ pipe.scheduler = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.conf
|
|
29 |
# lora_path = "./tbh368-sdxl.safetensors"
|
30 |
# pipe.load_lora_weights(lora_path, adapter_name="milton-glaser")
|
31 |
# pipe.set_adapters(["milton-glaser"], adapter_weights=[1.0])
|
32 |
-
pipe.load_lora_weights("
|
33 |
|
34 |
# ่ผๅ
ฅ CVAW Corpus ่ณๆ
|
35 |
cvaw_data = pd.read_csv('./CVAW_all_SD.csv', delimiter='\t')
|
@@ -125,7 +125,7 @@ def generate_images(history, conversation_times, last_genimg_times, generated_im
|
|
125 |
last_genimg_times = conversation_times
|
126 |
|
127 |
for i in range(4):
|
128 |
-
img = pipe("
|
129 |
negative_prompt=neg_prompt,
|
130 |
height=720, width=512,
|
131 |
generator=generator[i],
|
@@ -278,7 +278,7 @@ css = """
|
|
278 |
}
|
279 |
"""
|
280 |
|
281 |
-
with gr.Blocks(theme=theme, css=css) as demo:
|
282 |
generated_images = gr.State(value=None)
|
283 |
meditation_flag = gr.State(value=True)
|
284 |
last_genimg_times = gr.State(value=0)
|
@@ -286,6 +286,8 @@ with gr.Blocks(theme=theme, css=css) as demo:
|
|
286 |
valence_scores = gr.State(value=[])
|
287 |
arousal_scores = gr.State(value=[])
|
288 |
|
|
|
|
|
289 |
loading_message = gr.Textbox(visible=False, show_label=False)
|
290 |
with gr.Column(visible=False) as audio_interface:
|
291 |
audio_player = gr.Audio(label="ๆพ้ฌๅผๅฐๆๅฐ่ช", show_download_button=False, show_share_button=False, interactive=False)
|
@@ -309,8 +311,7 @@ with gr.Blocks(theme=theme, css=css) as demo:
|
|
309 |
selected_image = gr.Image(interactive=False, show_share_button=False, label="ไฝ ้ธๆ็ๅๅ")
|
310 |
image_chat_input = gr.Textbox(label="้ๅผตๅๅ่ฎไฝ ็ข็ไบไป้บผๆจฃ็่ฏๆณ๏ผ")
|
311 |
image_chat_button = gr.Button("่่ๅคฉๆฉๅจไบบๅไบซ", variant="primary")
|
312 |
-
|
313 |
-
|
314 |
# chatbot events handle
|
315 |
submit.click(handle_chat, [msg, chatbot, conversation_times, valence_scores, arousal_scores, meditation_flag], [chatbot, msg, submit, jump_to_med, meditation_buttons, conversation_times, valence_scores, arousal_scores, meditation_flag])
|
316 |
msg.submit(handle_chat, [msg, chatbot, conversation_times, valence_scores, arousal_scores, meditation_flag], [chatbot, msg, submit, jump_to_med, meditation_buttons, conversation_times, valence_scores, arousal_scores, meditation_flag])
|
|
|
29 |
# lora_path = "./tbh368-sdxl.safetensors"
|
30 |
# pipe.load_lora_weights(lora_path, adapter_name="milton-glaser")
|
31 |
# pipe.set_adapters(["milton-glaser"], adapter_weights=[1.0])
|
32 |
+
pipe.load_lora_weights("e-n-v-y/envyimpressionismxl01", weight_name="EnvyImpressionismXL01.safetensors", adapter_name="impressionism")
|
33 |
|
34 |
# ่ผๅ
ฅ CVAW Corpus ่ณๆ
|
35 |
cvaw_data = pd.read_csv('./CVAW_all_SD.csv', delimiter='\t')
|
|
|
125 |
last_genimg_times = conversation_times
|
126 |
|
127 |
for i in range(4):
|
128 |
+
img = pipe("modern digital impressionism, hard to understood, abstract, "+prompt,
|
129 |
negative_prompt=neg_prompt,
|
130 |
height=720, width=512,
|
131 |
generator=generator[i],
|
|
|
278 |
}
|
279 |
"""
|
280 |
|
281 |
+
with gr.Blocks(theme=theme, css=css, title='็็ๅฐ่ฉฑๆฉๅจไบบ') as demo:
|
282 |
generated_images = gr.State(value=None)
|
283 |
meditation_flag = gr.State(value=True)
|
284 |
last_genimg_times = gr.State(value=0)
|
|
|
286 |
valence_scores = gr.State(value=[])
|
287 |
arousal_scores = gr.State(value=[])
|
288 |
|
289 |
+
gr.Markdown("# ็็ๅฐ่ฉฑๆฉๅจไบบ")
|
290 |
+
Login = gr.LoginButton(value="็ปๅ
ฅ HuggingFace", logout_value="็ปๅบ", variant=primary, size=sm)
|
291 |
loading_message = gr.Textbox(visible=False, show_label=False)
|
292 |
with gr.Column(visible=False) as audio_interface:
|
293 |
audio_player = gr.Audio(label="ๆพ้ฌๅผๅฐๆๅฐ่ช", show_download_button=False, show_share_button=False, interactive=False)
|
|
|
311 |
selected_image = gr.Image(interactive=False, show_share_button=False, label="ไฝ ้ธๆ็ๅๅ")
|
312 |
image_chat_input = gr.Textbox(label="้ๅผตๅๅ่ฎไฝ ็ข็ไบไป้บผๆจฃ็่ฏๆณ๏ผ")
|
313 |
image_chat_button = gr.Button("่่ๅคฉๆฉๅจไบบๅไบซ", variant="primary")
|
314 |
+
|
|
|
315 |
# chatbot events handle
|
316 |
submit.click(handle_chat, [msg, chatbot, conversation_times, valence_scores, arousal_scores, meditation_flag], [chatbot, msg, submit, jump_to_med, meditation_buttons, conversation_times, valence_scores, arousal_scores, meditation_flag])
|
317 |
msg.submit(handle_chat, [msg, chatbot, conversation_times, valence_scores, arousal_scores, meditation_flag], [chatbot, msg, submit, jump_to_med, meditation_buttons, conversation_times, valence_scores, arousal_scores, meditation_flag])
|