File size: 888 Bytes
92913ed
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
49dd412
 
92913ed
 
 
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
29
30
31
32
33
import gradio as gr
import requests.exceptions
from huggingface_hub import HfApi, hf_hub_download
from huggingface_hub.repocard import metadata_load

def load_agent_video(model_id):
    """
    This function load the agent's video and results
    :return: video_path
    """
    video_path = hf_hub_download(model_id, filename="replay.mp4")
    return video_path

def get_metadata(model_id):
    """
    Get the metadata of the model repo
    :param model_id:
    :return: metadata
    """
    try:
        readme_path = hf_hub_download(model_id, filename="README.md")
        metadata = metadata_load(readme_path)
        print(metadata)
        return metadata
    except requests.exceptions.HTTPError:
        return None

agent1 = gr.Interface(load_agent_video, "text", "playable_video")
agent2 = gr.Interface(load_agent_video, "text", "playable_video")

gr.Parallel(agent1, agent2)