Commit
•
a4bb94e
1
Parent(s):
a18414d
Update app.py
Browse files
app.py
CHANGED
@@ -6,6 +6,19 @@ import torch
|
|
6 |
from PIL import Image
|
7 |
import random
|
8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
model_id = 'aipicasso/cool-japan-diffusion-2-1-2'
|
10 |
|
11 |
scheduler = EulerAncestralDiscreteScheduler(prediction_type="v_prediction") # .from_pretrained(model_id) # , subfolder="scheduler"
|
|
|
6 |
from PIL import Image
|
7 |
import random
|
8 |
|
9 |
+
import dns.resolver
|
10 |
+
import requests
|
11 |
+
|
12 |
+
# dnspythonを使用してDNSクエリを実行
|
13 |
+
resolver = dns.resolver.Resolver()
|
14 |
+
resolver.nameservers = ['8.8.8.8'] # GoogleのDNSサーバーを使用
|
15 |
+
answers = resolver.resolve('huggingface.co', 'A')
|
16 |
+
ip_address = answers[0].to_text()
|
17 |
+
|
18 |
+
# 得られたIPアドレスを使用してリクエストを行う
|
19 |
+
response = requests.get(f'http://{ip_address}/', headers={'Host': 'example.com'})
|
20 |
+
print(response.text)
|
21 |
+
|
22 |
model_id = 'aipicasso/cool-japan-diffusion-2-1-2'
|
23 |
|
24 |
scheduler = EulerAncestralDiscreteScheduler(prediction_type="v_prediction") # .from_pretrained(model_id) # , subfolder="scheduler"
|