ahmetdogan47 commited on
Commit
c9b78ae
·
verified ·
1 Parent(s): d538751

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -0
app.py ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from huggingface_hub import InferenceClient
3
+ import os
4
+ import numpy as np
5
+ import pathlib
6
+ import textwrap
7
+ import torch
8
+ from pathlib import Path
9
+ client = InferenceClient("meta-llama/Meta-Llama-3-8B-Instruct")
10
+
11
+ listen_client = InferenceClient("openai/whisper-medium")
12
+
13
+ USER = os.environ.get('USER')
14
+ PASS = os.environ.get('PASS')
15
+ def audio_change(audio):
16
+ return listen_client.automatic_speech_recognition(audio).text
17
+
18
+ gr.Interface(fn=audio_change, inputs=gr.Audio("Ses"), outputs=gr.Text()).launch()
19
+