File size: 509 Bytes
1108f7c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import requests
import gradio as gr

def get_random_file_from_s3(input_txt, api_key):

    url = "http://18.189.132.140:5218/run/predict"
    response = requests.post(
        url=url,
        json={
            "data": [
                "abcd",
                "J4g7Bv9Tm0A3Q6yZ"
            ]
        }
    ).json()
    
    file_url = response["data"][0]
    return file_url

gr.Interface(
    get_random_file_from_s3,
    inputs=[
        "text",
        "text"
    ],
    outputs=["text"]
).launch()