Because AWS Lambda runs in a Amazon Linux environment, to run external modules you must
sudo yum update -y| import tiktoken | |
| import langdetect | |
| T = tiktoken.get_encoding("o200k_base") | |
| length_dict = {} | |
| for i in range(T.n_vocab): | |
| try: | |
| length_dict[i] = len(T.decode([i])) | |
| except: |
| <%# Put this code snippet between the <head></head>-tags in your application layout and %> | |
| <%# replace 'UA-XXXXXXXX-X' with your own unique Google Analytics Tracking ID %> | |
| <%# ... %> | |
| <head> | |
| <%# ... %> | |
| <% if Rails.env.production? %> | |
| <script type="text/javascript"> | |
| (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ | |
| (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), |