Skip to content

Instantly share code, notes, and snippets.

Invoke-RestMethod -Uri "http://localhost:52415/v1/chat/completions" -Method Post -Headers @{"Content-Type"="application/json"} -Body '{"model": "meta-llama/Llama-3.1-70B-Instruct", "messages": [{"role": "user", "content": "テスト"}]}'
$PyScript = @"
import site, os
path = site.getsitepackages()[0]
filepath = os.path.join(path, 'resource.py')
with open(filepath, 'w') as f:
f.write('''def getpagesize(*args, **kwargs): return 4096
class _RUsage:
ru_maxrss = 0
def getrusage(*args, **kwargs): return _RUsage()
def getrlimit(*args, **kwargs): return (8192, 8192)