From the uDemy course on LLM engineering.
https://www.udemy.com/course/llm-engineering-master-ai-and-large-language-models
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
422 B
18 lines
422 B
import modal |
|
from modal import App, Image |
|
|
|
# Setup |
|
|
|
app = modal.App("hello") |
|
image = Image.debian_slim().pip_install("requests") |
|
|
|
# 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}!!"
|
|
|