File size: 409 Bytes
b483d5e
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
```python
import requests

def ingest_external_data(url):
    try:
        response = requests.get(url, timeout=5)
        # Zamieniamy tekst strony na liczby (macierz bajtów)
        raw_data = np.frombuffer(response.content[:16384], dtype=np.uint8)
        # Formujemy macierz 128x128 (jeśli mamy dość danych)
        matrix = torch.tensor(raw_data[:16384].reshape(128, 128)).float()
        
        #