Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upload file to language model video-indexer #10505

Closed
olaadapo opened this issue Jun 20, 2018 · 3 comments
Closed

upload file to language model video-indexer #10505

olaadapo opened this issue Jun 20, 2018 · 3 comments

Comments

@olaadapo
Copy link

how can I upload a text file to a language model in Video Indexer, using the Pythin API??

I have the following code:

files = {'this_file': open('thisfile.txt', 'rb')
accessString = '/trial/Accounts/'+accountId+'/Customization/Language?accessToken='+accessToken+'&modelName='+modelName+'&language='+language+'&%s'

headers = {
'Content-Type': 'multipart/form-data',
}

params = urllib.parse.urlencode({
})

try:
conn = http.client.HTTPSConnection('api.videoindexer.ai')
conn.request("POST", accessString % params, str(files), headers)
response = conn.getresponse()
modelInfo = response.read()
print(modelInfo)
conn.close()
except Exception as e:
print("[Errno {0}] {1}".format(e.errno, e.strerror))

@SaurabhSharma-MSFT
Copy link
Contributor

@olaadapo Could you provide us with the link to the document you are referring to ?

@olaadapo
Copy link
Author

Thanks for reaching out. The file is stored on my local computer, but since I am trying to construct an ETL pipeline, the following document can be used as an example case:
https://www.w3.org/TR/PNG/iso_8859-1.txt

@SaurabhSharma-MSFT
Copy link
Contributor

@olaadapo
I suggest you please open a new MSDN forum post with the details and community will help address your query. Please refer to below link to MSDN forum to ask new question -
https://social.msdn.microsoft.com/Forums/azure/en-US/newthread?category=windowsazureplatform.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants