Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -45,6 +45,7 @@ def transcribe(audio,prompt_num,user_keywords):
|
|
45 |
|
46 |
def keywords(text,prompt_num,user_keywords):
|
47 |
|
|
|
48 |
|
49 |
kw_model = KeyBERT()
|
50 |
a = kw_model.extract_keywords(text, keyphrase_ngram_range=(1, 3), stop_words=None)
|
@@ -134,10 +135,10 @@ def keywords(text,prompt_num,user_keywords):
|
|
134 |
imgs_comb = np.hstack([i.resize(min_shape) for i in images])
|
135 |
imgs_comb = Image.fromarray( imgs_comb)
|
136 |
|
137 |
-
return images
|
138 |
|
139 |
speech_text = gr.Interface(fn=transcribe, inputs=[gr.Audio(source="microphone", type="filepath"),gr.Number(placeholder = "Number of Images to be generated (int): "),gr.Textbox(placeholder = "Additional keywords (comma delimitied): ")], outputs=["text","number","text"], title = 'Speech to Image Generator', enable_queue=True)
|
140 |
-
text_prompts = gr.Interface(fn=keywords, inputs=["text","number","text"], outputs=gr.Gallery(label="Generated images", show_label=False, elem_id="gallery").style(grid=[2], height="auto"), title = 'Speech to Image Generator', enable_queue=True)
|
141 |
|
142 |
gr.Series(speech_text,text_prompts).launch(inline = False, enable_queue=True).queue()
|
143 |
|
|
|
45 |
|
46 |
def keywords(text,prompt_num,user_keywords):
|
47 |
|
48 |
+
transcription = text
|
49 |
|
50 |
kw_model = KeyBERT()
|
51 |
a = kw_model.extract_keywords(text, keyphrase_ngram_range=(1, 3), stop_words=None)
|
|
|
135 |
imgs_comb = np.hstack([i.resize(min_shape) for i in images])
|
136 |
imgs_comb = Image.fromarray( imgs_comb)
|
137 |
|
138 |
+
return images,transcription,keyword_pool,generated_prompts
|
139 |
|
140 |
speech_text = gr.Interface(fn=transcribe, inputs=[gr.Audio(source="microphone", type="filepath"),gr.Number(placeholder = "Number of Images to be generated (int): "),gr.Textbox(placeholder = "Additional keywords (comma delimitied): ")], outputs=["text","number","text"], title = 'Speech to Image Generator', enable_queue=True)
|
141 |
+
text_prompts = gr.Interface(fn=keywords, inputs=["text","number","text"], outputs=[gr.Gallery(label="Generated images", show_label=False, elem_id="gallery").style(grid=[2], height="auto"),"text","text","text"], title = 'Speech to Image Generator', enable_queue=True)
|
142 |
|
143 |
gr.Series(speech_text,text_prompts).launch(inline = False, enable_queue=True).queue()
|
144 |
|