This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Receta (desde Windows, con WSL2): | |
# git clone https://github.com/aws-deepracer-community/deepracer-for-cloud # clonar repo (solo la 1ª vez). | |
# sudo apt-get install jq awscli python3-boto3 docker-compose # instalar dependencias (solo la 1ª vez). | |
# docker swarm leave --force | |
bin/init.sh -a cpu -c local | |
# aws configure --profile minio # Configurar un perfil para S3 local (solo la 1ª vez). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Original version: https://github.com/huggingface/transformers/blob/master/src/transformers/models/bart/modeling_bart.py | |
# Attempt for NLP Spain AI challenge (http://www.spain-ai.com/hackathon2020_reto_NLP.php) | |
# Loss_v2 = num_productos_no_acertados + porcentaje_tokens_no_acertados + 0,001 * default_loss | |
lm_logits = self.lm_head(outputs[0]) + self.final_logits_bias | |
masked_lm_loss = None | |
if labels is not None: | |
BATCH_SIZE = 8 | |
cuda0 = torch.device('cuda:0') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Sentry = require("@sentry/serverless"); | |
Sentry.AWSLambda.init({ | |
dsn: 'https://[email protected]/0', // cambiar por el DSN que te proporciona Sentry. | |
tracesSampleRate: 1.0, | |
}); | |
exports.handler = Sentry.AWSLambda.wrapHandler(async (event, context) => { | |
// Your handler code | |
// TODO |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* eslint-disable no-console */ | |
/* eslint-disable global-require */ | |
// More info about Alexa Location Services: | |
// https://developer.amazon.com/es-ES/docs/alexa/custom-skills/location-services-for-alexa-skills.html | |
const auto = { | |
getFrescuraSegundos(handlerInput) { | |
var geoObject = handlerInput.requestEnvelope.context.Geolocation; | |
return (new Date(handlerInput.requestEnvelope.request.timestamp) - new Date(geoObject.timestamp)) / 1000; // freshness in seconds |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const HelloWorldIntentHandler = { | |
canHandle(handlerInput) { | |
return Alexa.getRequestType(handlerInput.requestEnvelope) === 'IntentRequest' | |
&& Alexa.getIntentName(handlerInput.requestEnvelope) === 'HelloWorldIntent'; | |
}, | |
handle(handlerInput) { | |
var accessToken = handlerInput.requestEnvelope.context.System.user.accessToken; // obtener el Access Token (si lo hay) | |
var speechText = ''; | |
if (accessToken == undefined){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const https = require('https'); | |
const mode = 'prod'; // dev or 'prod' | |
const clientID = 'xxx'; // obtenido de consola web de Alexa developers. | |
const clientSecret = 'xxx'; // obtenido de consola web de Alexa developers. | |
let tokenGlobal = null; // se usa para enviar notificaciones. Dura 1h. Se rellena en notify(). | |
// Ejemplo de envío de una notificación | |
const who = 'cake'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"manifest": { | |
"apis": { | |
// ... | |
}, | |
"manifestVersion": "1.0", | |
"privacyAndCompliance": { | |
// ... | |
}, | |
"publishingInformation": { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
"types": [ | |
{ | |
"name": "LIST_OF_PRODUCT_NAMES", | |
"values": [ | |
{ | |
"id": "nameproductpurchase", /* id de producto comprable (isp)*/ | |
"name": { | |
"value": "suscripción premium", | |
"synonyms": [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Ejemplo de intent handler que sugiere la compra del in-skill purchase si no se | |
* ha comprado ya antes y además el usuario puede comprarlo (purchasable) | |
*/ | |
const HelloWorldIntentHandler = { | |
canHandle(handlerInput) { | |
return handlerInput.requestEnvelope.request.type === 'IntentRequest' | |
&& handlerInput.requestEnvelope.request.intent.name === 'HelloWorldIntent'; | |
}, | |
handle(handlerInput) { | |
SessionState.setCurrentState(handlerInput, SessionState.STATES.HELLO_WORLD); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const skillBuilder = Alexa.SkillBuilders.custom(); | |
exports.handler = skillBuilder | |
.addRequestHandlers( | |
... | |
PurchaseHandlers.WhatCanIBuyIntentHandler, // purchase handlers | |
PurchaseHandlers.TellMeMoreAboutProductIntentHandler, | |
PurchaseHandlers.BuyIntentHandler, | |
PurchaseHandlers.BuyResponseHandler, | |
PurchaseHandlers.PurchaseHistoryIntentHandler, | |
PurchaseHandlers.RefundProductIntentHandler, |
NewerOlder