Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
-
import requests
|
2 |
import streamlit as st
|
3 |
from huggingface_hub import InferenceClient
|
4 |
from gradio_client import Client
|
5 |
import re
|
|
|
6 |
|
7 |
# Set the page config
|
8 |
st.set_page_config(layout="wide")
|
@@ -66,17 +66,11 @@ def generate_image(prompt):
|
|
66 |
return None
|
67 |
|
68 |
def get_pepe_price():
|
69 |
-
|
70 |
-
params = {
|
71 |
-
'ids': 'pepe',
|
72 |
-
'vs_currencies': 'usd'
|
73 |
-
}
|
74 |
try:
|
75 |
-
|
76 |
-
response.raise_for_status()
|
77 |
-
price_data = response.json()
|
78 |
return price_data['pepe']['usd']
|
79 |
-
except
|
80 |
st.error(f"Error fetching PEPE price: {e}")
|
81 |
return None
|
82 |
|
|
|
|
|
1 |
import streamlit as st
|
2 |
from huggingface_hub import InferenceClient
|
3 |
from gradio_client import Client
|
4 |
import re
|
5 |
+
from pycoingecko import CoinGeckoAPI
|
6 |
|
7 |
# Set the page config
|
8 |
st.set_page_config(layout="wide")
|
|
|
66 |
return None
|
67 |
|
68 |
def get_pepe_price():
|
69 |
+
cg = CoinGeckoAPI()
|
|
|
|
|
|
|
|
|
70 |
try:
|
71 |
+
price_data = cg.get_price(ids='pepe', vs_currencies='usd')
|
|
|
|
|
72 |
return price_data['pepe']['usd']
|
73 |
+
except Exception as e:
|
74 |
st.error(f"Error fetching PEPE price: {e}")
|
75 |
return None
|
76 |
|