Updated README and Week 8 coming together

This commit is contained in:
Edward Donner
2024-09-26 10:04:55 -04:00
parent 0fd4c84b24
commit 2f997952fc
17 changed files with 3204 additions and 24 deletions

19
week8_wip/hello.py Normal file
View File

@@ -0,0 +1,19 @@
import modal
from modal import App, Volume, Image
# Setup
app = modal.App("hello")
image = Image.debian_slim().pip_install("requests")
gpu = "T4"
# Hello!
@app.function(image=image)
def hello() -> str:
import requests
response = requests.get('https://ipinfo.io/json')
data = response.json()
city, region, country = data['city'], data['region'], data['country']
return f"Hello from {city}, {region}, {country}!!"