Skip to content

Instantly share code, notes, and snippets.

import os
import io
import boto3
import json
import csv
# Get the Endpoint name form the Environment.
ENDPOINT_NAME = os.environ['ENDPOINT_NAME']
# Make a SageMaker Runtime reference.
from sagemaker.huggingface import HuggingFaceModel
from sagemaker.serverless import ServerlessInferenceConfig
import sagemaker
role = sagemaker.get_execution_role()
# Hub Model configuration. https://huggingface.co/models
hub = {
'HF_MODEL_ID':'dalle-mini/dalle-mini',
'HF_TASK':'image-classification'
}
from sagemaker.huggingface import HuggingFaceModel
from sagemaker.serverless import ServerlessInferenceConfig
import sagemaker
role = sagemaker.get_execution_role()
# Hub Model configuration. https://huggingface.co/models
hub = {
'HF_MODEL_ID':'dalle-mini/dalle-mini',
'HF_TASK':'image-classification'
}
@crajah
crajah / Database.scala
Created November 7, 2020 17:50
In this example, airports, flights and airportSearch are constructed inside the Graph object. However, I want to be able to create the Graph first then create the Collection[D] on the fly.
object database extends Graph(databaseName = "graphTest") {
val airports: DocumentCollection[Airport] = vertex[Airport]
val flights: DocumentCollection[Flight] = edge[Flight]
val airportSearch: View[Airport] = view(
name = "airportSearch",
collection = airports,
analyzers = List(Analyzer.Identity),
includeAllFields = true,
fields = Airport.name -> List(Analyzer.TextEnglish)
)
@crajah
crajah / ArangoDAOTest.scala
Created November 7, 2020 14:38
Scala Arango DB Connector
package parallelai.loop.api.dao
import java.net.URL
import com.outr.arango.CollectionType._
import com.outr.arango._
import com.outr.arango.query._
import com.outr.arango.transaction.Transaction
import io.youi.net.URL
import parallelai.loop.api.model.dto.Long