Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -3,7 +3,6 @@ import logging
|
|
3 |
import os
|
4 |
import uuid
|
5 |
import subprocess
|
6 |
-
from deep_translator import GoogleTranslator
|
7 |
from gradio_client import Client
|
8 |
|
9 |
# λ‘κΉ
μ€μ
|
@@ -39,8 +38,7 @@ class MyClient(discord.Client):
|
|
39 |
self.is_processing = True
|
40 |
try:
|
41 |
prompt = message.content[len('!image '):]
|
42 |
-
|
43 |
-
image_path = await self.generate_image(prompt_en)
|
44 |
user_id = message.author.id
|
45 |
await message.channel.send(
|
46 |
f"<@{user_id}> λμ΄ μμ²νμ μ΄λ―Έμ§μ
λλ€.",
|
@@ -80,12 +78,6 @@ class MyClient(discord.Client):
|
|
80 |
logging.error(f'μ΄λ―Έμ§ μμ± λμ€ μμΈ λ°μ: {e}')
|
81 |
raise RuntimeError(f"μ΄λ―Έμ§ μμ± λμ€ μμΈ λ°μ: {str(e)}")
|
82 |
|
83 |
-
async def translate_prompt(prompt):
|
84 |
-
logging.debug(f'ν둬ννΈ λ²μ μ€: {prompt}')
|
85 |
-
translated_text = GoogleTranslator(source='ko', target='en').translate(prompt)
|
86 |
-
logging.debug(f'λ²μλ ν
μ€νΈ: {translated_text}')
|
87 |
-
return translated_text
|
88 |
-
|
89 |
async def initiate_conversation(prompt, image_path, message):
|
90 |
logging.debug(f'λν μμ μ€: {prompt}')
|
91 |
description = "μμ±λ μ΄λ―Έμ§μ
λλ€."
|
|
|
3 |
import os
|
4 |
import uuid
|
5 |
import subprocess
|
|
|
6 |
from gradio_client import Client
|
7 |
|
8 |
# λ‘κΉ
μ€μ
|
|
|
38 |
self.is_processing = True
|
39 |
try:
|
40 |
prompt = message.content[len('!image '):]
|
41 |
+
image_path = await self.generate_image(prompt)
|
|
|
42 |
user_id = message.author.id
|
43 |
await message.channel.send(
|
44 |
f"<@{user_id}> λμ΄ μμ²νμ μ΄λ―Έμ§μ
λλ€.",
|
|
|
78 |
logging.error(f'μ΄λ―Έμ§ μμ± λμ€ μμΈ λ°μ: {e}')
|
79 |
raise RuntimeError(f"μ΄λ―Έμ§ μμ± λμ€ μμΈ λ°μ: {str(e)}")
|
80 |
|
|
|
|
|
|
|
|
|
|
|
|
|
81 |
async def initiate_conversation(prompt, image_path, message):
|
82 |
logging.debug(f'λν μμ μ€: {prompt}')
|
83 |
description = "μμ±λ μ΄λ―Έμ§μ
λλ€."
|