Takimoe commited on
Commit
7c775d0
·
1 Parent(s): 1fa78fa

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +12 -3
README.md CHANGED
@@ -1,3 +1,12 @@
1
- ---
2
- license: openrail
3
- ---
 
 
 
 
 
 
 
 
 
 
1
+ import requests
2
+
3
+ API_URL = "https://api-inference.huggingface.co/models/chompk/wav2vec2-large-xlsr-thai-tokenized"
4
+ headers = {"Authorization": f"Bearer {API_TOKEN}"}
5
+
6
+ def query(filename):
7
+ with open(filename, "rb") as f:
8
+ data = f.read()
9
+ response = requests.post(API_URL, headers=headers, data=data)
10
+ return response.json()
11
+
12
+ output = query("sample1.flac")