eaglelandsonce commited on
Commit
e754266
·
verified ·
1 Parent(s): 150cf0a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -13
app.py CHANGED
@@ -13,18 +13,12 @@ st.sidebar.title("Text to Audio")
13
  PAT = st.sidebar.text_input("Enter your Personal Access Token:", type="password")
14
 
15
  # Authentication details (hide or secure this in production!)
16
- '''
17
- USER_ID = 'openai'
18
- APP_ID = 'tss'
19
- MODEL_ID = 'openai-tts-1'
20
- MODEL_VERSION_ID = 'fff6ce1fd487457da95b79241ac6f02d'
21
- '''
22
 
23
- USER_ID = 'eleven-labs'
24
- APP_ID = 'audio-generation'
25
  # Change these to whatever model and text URL you want to use
26
- MODEL_ID = 'speech-synthesis'
27
- MODEL_VERSION_ID = 'f2cead3a965f4c419a61a4a9b501095c'
28
 
29
  # pad buffer
30
  def pad_buffer(audio):
@@ -49,14 +43,14 @@ if submit_button:
49
  channel = ClarifaiChannel.get_grpc_channel()
50
  stub = service_pb2_grpc.V2Stub(channel)
51
  metadata = (('authorization', 'Key ' + PAT),)
52
- userDataObject = resources_pb2.UserAppIDSet(user_id=USER_ID, app_id=APP_ID)
53
 
54
  try:
55
  response = stub.PostModelOutputs(
56
  service_pb2.PostModelOutputsRequest(
57
  user_app_id=userDataObject,
58
- model_id=MODEL_ID,
59
- version_id=MODEL_VERSION_ID,
60
  inputs=[resources_pb2.Input(data=resources_pb2.Data(text=resources_pb2.Text(raw=input_text)))]
61
  ),
62
  metadata=metadata
 
13
  PAT = st.sidebar.text_input("Enter your Personal Access Token:", type="password")
14
 
15
  # Authentication details (hide or secure this in production!)
 
 
 
 
 
 
16
 
17
+ USER_ID2 = 'eleven-labs'
18
+ APP_ID2 = 'audio-generation'
19
  # Change these to whatever model and text URL you want to use
20
+ MODEL_ID2 = 'speech-synthesis'
21
+ MODEL_VERSION_ID2 = 'f2cead3a965f4c419a61a4a9b501095c'
22
 
23
  # pad buffer
24
  def pad_buffer(audio):
 
43
  channel = ClarifaiChannel.get_grpc_channel()
44
  stub = service_pb2_grpc.V2Stub(channel)
45
  metadata = (('authorization', 'Key ' + PAT),)
46
+ userDataObject = resources_pb2.UserAppIDSet(user_id=USER_ID2, app_id=APP_ID2)
47
 
48
  try:
49
  response = stub.PostModelOutputs(
50
  service_pb2.PostModelOutputsRequest(
51
  user_app_id=userDataObject,
52
+ model_id=MODEL_ID2,
53
+ version_id=MODEL_VERSION_ID2,
54
  inputs=[resources_pb2.Input(data=resources_pb2.Data(text=resources_pb2.Text(raw=input_text)))]
55
  ),
56
  metadata=metadata