Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,8 +2,10 @@ import os
|
|
| 2 |
import gradio as gr
|
| 3 |
import logging
|
| 4 |
|
| 5 |
-
|
| 6 |
-
logging.
|
|
|
|
|
|
|
| 7 |
|
| 8 |
API_KEY=os.environ.get('HUGGING_FACE_HUB_TOKEN', None)
|
| 9 |
article = """---
|
|
@@ -33,8 +35,10 @@ def selectModel(message):
|
|
| 33 |
for i in range(len(models)):
|
| 34 |
if message.find(models[i].prefix)!=-1:
|
| 35 |
c_model=models[i].path
|
|
|
|
| 36 |
return c_model
|
| 37 |
c_model=models[i].path
|
|
|
|
| 38 |
return c_model
|
| 39 |
|
| 40 |
sandbox = gr.Interface.load(
|
|
@@ -46,5 +50,5 @@ sandbox = gr.Interface.load(
|
|
| 46 |
article=article,
|
| 47 |
api_key=API_KEY
|
| 48 |
)
|
| 49 |
-
logging.
|
| 50 |
sandbox.queue(concurrency_count=20).launch()
|
|
|
|
| 2 |
import gradio as gr
|
| 3 |
import logging
|
| 4 |
|
| 5 |
+
LOG_FORMAT = '%(asctime)s - %(levelname)s [%(name)s] %(funcName)s -> %(message)s'
|
| 6 |
+
logging.basicConfig(level = logging.DEBUG, format = LOG_FORMAT)
|
| 7 |
+
logger = logging.getLogger(__name__)
|
| 8 |
+
logger.debug('Logging started')
|
| 9 |
|
| 10 |
API_KEY=os.environ.get('HUGGING_FACE_HUB_TOKEN', None)
|
| 11 |
article = """---
|
|
|
|
| 35 |
for i in range(len(models)):
|
| 36 |
if message.find(models[i].prefix)!=-1:
|
| 37 |
c_model=models[i].path
|
| 38 |
+
logging.warning('model selected = '+c_model)
|
| 39 |
return c_model
|
| 40 |
c_model=models[i].path
|
| 41 |
+
logging.warning('model selected = '+c_model)
|
| 42 |
return c_model
|
| 43 |
|
| 44 |
sandbox = gr.Interface.load(
|
|
|
|
| 50 |
article=article,
|
| 51 |
api_key=API_KEY
|
| 52 |
)
|
| 53 |
+
logging.warning('model chosen = '+custom_model)
|
| 54 |
sandbox.queue(concurrency_count=20).launch()
|