# Impossible de crée un lien de partage avec Gradio en python

**URL:** <https://www.debian-fr.org/t/impossible-de-cree-un-lien-de-partage-avec-gradio-en-python/88713>\
**Category:** Programmation\
**Tags:** python\
**Created:** [Août 26, 2023, 8:47 UTC](https://www.debian-fr.org/t/impossible-de-cree-un-lien-de-partage-avec-gradio-en-python/88713 "2023-08-26T08:47:13Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![gabriel75](https://www.debian-fr.org/user_avatar/www.debian-fr.org/gabriel75/32/12826_2.png) [@gabriel75](https://www.debian-fr.org/u/gabriel75)\
**Post date:** [Août 26, 2023, 8:47 UTC](https://www.debian-fr.org/t/impossible-de-cree-un-lien-de-partage-avec-gradio-en-python/88713/1 "2023-08-26T08:47:13Z")

</div>

J’ai programmé un script python avec la bibliothèque Gradio. J’essaye d’obtenir une URL publique de partage lors de l’exécution, mais j’obtiens cette erreur :

```auto
Could not create share link. Missing file: /home/gabriel/.local/lib/python3.9/site-packages/gradio/frpc_linux_aarch64_v0.2. 

Please check your internet connection. This can happen if your antivirus software blocks the download of this file. You can install manually by following these steps: 

1. Download this file: https://cdn-media.huggingface.co/frpc-gradio-0.2/frpc_linux_aarch64
2. Rename the downloaded file to: frpc_linux_aarch64_v0.2
3. Move the file to this location: /home/gabriel/.local/lib/python3.9/site-packages/gradio

```

Le souci est que je n’arrive pas à télécharger le fichier en question, car leur lien ne fonctionne pas.

```auto
gabriel@raspberrypi ~> wget https://cdn-media.huggingface.co/frpc-gradio-0.2/frpc_linux_aarch64
--2023-08-25 21:42:22-- https://cdn-media.huggingface.co/frpc-gradio-0.2/frpc_linux_aarch64
Résolution de cdn-media.huggingface.co (cdn-media.huggingface.co)… 2600:9000:2450:7e00:19:6fb8:2ac0:93a1, 2600:9000:2450:9e00:19:6fb8:2ac0:93a1, 2600:9000:2450:8400:19:6fb8:2ac0:93a1, ...
Connexion à cdn-media.huggingface.co (cdn-media.huggingface.co)|2600:9000:2450:7e00:19:6fb8:2ac0:93a1|:443… connecté.
requête HTTP transmise, en attente de la réponse… 403 Forbidden
2023-08-25 21:42:22 erreur 403 : Forbidden.

```

---

<div class="post-metadata">

**Author:** ![vbreton](https://www.debian-fr.org/user_avatar/www.debian-fr.org/vbreton/32/11400_2.png) [@vbreton](https://www.debian-fr.org/u/vbreton)\
**Post date:** [Août 26, 2023, 4:49 UTC](https://www.debian-fr.org/t/impossible-de-cree-un-lien-de-partage-avec-gradio-en-python/88713/2 "2023-08-26T16:49:04Z")

</div>

Bonsoir @gabriel75,

Avec pas d’autres précisions, la seule chose que j’obtiens est un «&nbsp;accès refusé&nbsp;». N’hésite pas à donner suffisamment d’informations pour reproduire ton problème pour éventuellement pouvoir le corriger.

---

<div class="post-metadata">

**Author:** ![PengouinPdt](https://www.debian-fr.org/user_avatar/www.debian-fr.org/pengouinpdt/32/3978_2.png) [@PengouinPdt](https://www.debian-fr.org/u/PengouinPdt)\
**Post date:** [Août 27, 2023, 6:25 UTC](https://www.debian-fr.org/t/impossible-de-cree-un-lien-de-partage-avec-gradio-en-python/88713/3 "2023-08-27T06:25:26Z")

</div>

> [@gabriel75](#):
>
> `https://cdn-media.huggingface.co/frpc-gradio-0.2/frpc_linux_aarch64`

> AccessDeniedAccess DeniedWJ2VAKCCTMGKG26WSB4mdwrawevpL1KN/uKwftsHLRu8AWj+DDT/mPXJZ1EqDlFwcAnrM0vBmJzsnUTD55w3hRtlg6E=

Accès refusé !

ça parle tout seul !

* * *

Est-ce relatif à ça : [https://www.gradio.app/](https://www.gradio.app/) ?

---

<div class="post-metadata">

**Author:** ![gabriel75](https://www.debian-fr.org/user_avatar/www.debian-fr.org/gabriel75/32/12826_2.png) [@gabriel75](https://www.debian-fr.org/u/gabriel75)\
**Post date:** [Août 27, 2023, 8:18 UTC](https://www.debian-fr.org/t/impossible-de-cree-un-lien-de-partage-avec-gradio-en-python/88713/4 "2023-08-27T08:18:40Z")

</div>

Voici une version raccourcie du programme en question :

```
import openai
import gradio

openai.api_key = "sk- ***************"

messages = [{"role": "system", "content": "Je veux *************."}]

def main(Nom_du_livre):
    messages.append({"role": "user", "content": Nom_du_livre})
    response = openai.ChatCompletion.create(
        model="gpt-3.5-turbo",
        messages=messages
    )
    reply = response["choices"][0]["message"]["content"]
    messages.append({"role": "assistant", "content": reply})
    return reply

demo = gradio.Interface(fn=main, inputs="text",
                        outputs="text", title="Générteur de fiche de lecture")

demo.launch(share=True)
```

---

<div class="post-metadata">

**Author:** ![gabriel75](https://www.debian-fr.org/user_avatar/www.debian-fr.org/gabriel75/32/12826_2.png) [@gabriel75](https://www.debian-fr.org/u/gabriel75)\
**Post date:** [Août 27, 2023, 8:19 UTC](https://www.debian-fr.org/t/impossible-de-cree-un-lien-de-partage-avec-gradio-en-python/88713/5 "2023-08-27T08:19:31Z")

</div>

Oui c’est bien relatif à cette bibliothèque

Voici la doc officiel relatif sur ce que j’essaye de faire dans le 1. Mais rien ne me permet de résoudre ce problème.

> **[Sharing Your App](https://www.gradio.app/guides/sharing-your-app#sharing-demos)**
>
> A Step-by-Step Gradio Tutorial

---

<div class="post-metadata">

**Author:** ![gabriel75](https://www.debian-fr.org/user_avatar/www.debian-fr.org/gabriel75/32/12826_2.png) [@gabriel75](https://www.debian-fr.org/u/gabriel75)\
**Post date:** [Août 27, 2023, 10:28 UTC](https://www.debian-fr.org/t/impossible-de-cree-un-lien-de-partage-avec-gradio-en-python/88713/6 "2023-08-27T10:28:33Z")

</div>

J’ai essayé de l’exécuter avec l’interpréteur python de Windows et d’Anaconda et toujours le même problème.

---

<div class="post-metadata">

**Author:** ![PengouinPdt](https://www.debian-fr.org/user_avatar/www.debian-fr.org/pengouinpdt/32/3978_2.png) [@PengouinPdt](https://www.debian-fr.org/u/PengouinPdt)\
**Post date:** [Août 28, 2023, 8:09 UTC](https://www.debian-fr.org/t/impossible-de-cree-un-lien-de-partage-avec-gradio-en-python/88713/7 "2023-08-28T08:09:39Z")

</div>

Le mieux est de voir avec la communauté existante et officielle :

> **[Gradio](https://discuss.huggingface.co/c/gradio/26)**
>
> This category is for any question related to the Gradio library. You can also file an issue.

---

<div class="post-metadata">

**Author:** ![gabriel75](https://www.debian-fr.org/user_avatar/www.debian-fr.org/gabriel75/32/12826_2.png) [@gabriel75](https://www.debian-fr.org/u/gabriel75)\
**Post date:** [Août 28, 2023, 8:53 UTC](https://www.debian-fr.org/t/impossible-de-cree-un-lien-de-partage-avec-gradio-en-python/88713/8 "2023-08-28T08:53:02Z")

</div>

Très bien, je vais voir avec eux est vous transmettre la solution si on en trouve une.
