{"id":15632340,"url":"https://github.com/xingyaoww/pepe-api-server","last_synced_at":"2025-03-29T19:13:48.700Z","repository":{"id":81908312,"uuid":"507668906","full_name":"xingyaoww/pepe-api-server","owner":"xingyaoww","description":null,"archived":false,"fork":false,"pushed_at":"2022-06-27T03:42:44.000Z","size":37,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-04T19:51:25.375Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xingyaoww.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-06-26T19:43:02.000Z","updated_at":"2022-06-27T03:32:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"de3b5660-febd-4115-a9f4-9c80d1f75e66","html_url":"https://github.com/xingyaoww/pepe-api-server","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xingyaoww%2Fpepe-api-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xingyaoww%2Fpepe-api-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xingyaoww%2Fpepe-api-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xingyaoww%2Fpepe-api-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xingyaoww","download_url":"https://codeload.github.com/xingyaoww/pepe-api-server/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246230541,"owners_count":20744349,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T10:43:36.029Z","updated_at":"2025-03-29T19:13:48.674Z","avatar_url":"https://github.com/xingyaoww.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# About\n\nThis is a repo contains code necessary to deploy GIF Reply model released at [here](https://github.com/xingyaoww/gif-reply).\n\nIt is based on work described in the Findings of EMNLP 2021 paper [An animated picture says at least a thousand words: Selecting Gif-based Replies in Multimodal Dialog](https://arxiv.org/abs/2109.12212)\nby [Xingyao Wang](https://xingyaoww.github.io/) and [David Jurgens](https://jurgens.people.si.umich.edu/):\n\n```\n@inproceedings{\n  author = {Wang, Xingyao and Jurgens, David},\n  year = 2021,\n  title = {{An Animated Picture Says at Least a Thousand Words: Selecting Gif-based Replies in Multimodal Dialog}},\n  booktitle = {Proceedings of the Findings of the 2021 Conference on Empirical Methods in Natural Language Processing (Findings of EMNLP)}\n}  \n```\n\n# Dataset Preparation\n\nFollow [here](https://github.com/xingyaoww/gif-reply/tree/main/data) to download all the data under `data/release`. Required data are:\n\n- `gif-pepe-inferred-features.csv`\n- `PEPE-model-checkpoint.pth`\n- `gif-id-to-giphy-id-mapping.csv`\n\nYou also need to download `base-vg-labels` version of [Oscar Model](https://github.com/microsoft/Oscar/blob/master/DOWNLOAD.md), and put in under `data/oscar-pretrained-model`.\n\nIf you want to have a copy of all gifs locally (otherwise it is preferred to use `https://media.giphy.com/media/${GIPHY_ID}/giphy.mp4` to visualize GIFs): download gifs follow GIF IDs in `gif-pepe-inferred-features.csv`, and put them under `data/file/gifs` with hierarchical GIF ID naming (e.g. Original GIF ID `abcdef` convert to `a/b/c/def`, GIF File `abcdef.mp4` to `a/b/c/def.mp4`).\n\n# Prepare Environment and Start the server\n\n```bash\nconda env create -n pepe-api-server --file environment.yml \nconda activate\npython -m spacy download en_core_web_sm\n./run-api-server.sh\n```\n\n# Inference through REST API\n\n```bash\ncurl -X POST ${API_SERVER_URL}:${API_SERVER_PORT}/api/v1/retrieve -H 'Content-Type: application/json' -d '{\"text\": \"Hello there!\", \"num_resp_gifs\": 5}'\n```\n\nwhere `num_resp_gifs` is the number of reponse gif required.\n\nExample response:\n\n```json\n{\n  \"gif_ids\": [\n    \"ffdf5e5e60200006ffdf5f5e60200002dfdf5e5e60200002\",\n    \"ffede0c00083c3c7fee6e4c00206c686fff6e4e00083c2c3\",\n    \"c6e6c0d6cfcbc0c3c6e6c0decfcbc0c3c6e6c0decfcbc0c3\",\n    \"7f1f0f0f1c1c18101f5b1f0f0702081c1f9f1f1f07031a18\",\n    \"ffffcf830f0d0100ffff8f030f010100bf1f0f030f01013c\"\n  ],\n  \"giphy_ids\": [\n    \"rx3flR1eNqciQ\",\n    \"11Dkb1VvEib7fW\",\n    \"3oriO04qxVReM5rJEA\",\n    \"3o6Zt2PMtvg1hKOrh6\",\n    \"FhDgTdtbXSRnW\"\n  ],\n  \"internal_links\": [\n    \"/file/gifs/r/x/3/flR1eNqciQ.mp4\",\n    \"/file/gifs/1/1/D/kb1VvEib7fW.mp4\",\n    \"/file/gifs/3/o/r/iO04qxVReM5rJEA.mp4\",\n    \"/file/gifs/3/o/6/Zt2PMtvg1hKOrh6.mp4\",\n    \"/file/gifs/F/h/D/gTdtbXSRnW.mp4\"\n  ],\n  \"msg\": \"\",\n  \"normalized_text\": \"Hello there !\"\n}\n```\n\nAnd you can download each response gif from the `internal_links` field (e.g. `wget ${API_SERVER_URL}:${API_SERVER_PORT}/file/gifs/r/x/3/flR1eNqciQ.mp4`).\n\nYou can also monitor the request received by accessing `http://${API_SERVER_URL}:${API_SERVER_PORT}/dashboard/overview` (default username \u0026 password are both `admin`).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxingyaoww%2Fpepe-api-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxingyaoww%2Fpepe-api-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxingyaoww%2Fpepe-api-server/lists"}