This file contains 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
import type { NextRequest } from "next/server"; | |
import { isEmpty } from "lodash"; | |
import { OPENAI_API_KEY } from "../../utils/variables"; | |
import { OpenAICompletionsPayload, models } from "../../utils/types"; | |
export const config = { | |
runtime: "edge", | |
}; | |
export default async function handler(req: NextRequest) { |
This file contains 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
@composite_solid | |
def get_data() -> constants.PandasDataFrame: | |
local_path, s3_coordninates = io_solids.get_data_location() | |
io_solids.read_csv_as_df_locally(local_path) | |
io_solids.read_csv_as_df_s3(s3_coordninates) | |
# dagster.core.errors.DagsterUserCodeProcessError: dagster.core.errors.DagsterInvalidDefinitionError: @composite_solid 'get_data' has unmapped output 'result'. Remove it or return a value from the appropriate solid invocation. | |
@composite_solid(output_defs=[ |
This file contains 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
PipelineOptions options = PipelineOptionsFactory.create(); // configs | |
Pipeline p = Pipeline.create(options); | |
p.apply(TextIO.read().from("/shakespeare.txt")) // load the data | |
.apply("ExtractWords", FlatMapElements | |
.into(TypeDescriptors.strings()) | |
.via((String word) -> Arrays.asList(word.split("[^\\p{L}]+")))) // split lines where each element is a word - ParDo | |
.apply(Count.<String>perElement()) // Convert PCollection into a Key/Value pair: word/# of occurences | |
.apply("FormatResults", MapElements | |
.into(TypeDescriptors.strings()) |
This file contains 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
package edu.sjsu.cs185C; | |
import java.io.IOException; | |
import java.util.Iterator; | |
import java.util.Map; | |
import java.util.NavigableMap; | |
import org.apache.hadoop.conf.Configuration; | |
import org.apache.hadoop.hbase.Cell; | |
import org.apache.hadoop.hbase.HBaseConfiguration; | |
import org.apache.hadoop.hbase.TableName; |
This file contains 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
package edu.sjsu.cs185C; | |
import java.io.BufferedReader; | |
import java.io.FileReader; | |
import java.io.IOException; | |
import org.apache.hadoop.conf.Configuration; | |
import org.apache.hadoop.hbase.HBaseConfiguration; | |
import org.apache.hadoop.hbase.HColumnDescriptor; |
This file contains 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
package edu.sjsu.cs185C; | |
import org.ojai.Document; | |
import org.ojai.DocumentStream; | |
import org.ojai.FieldPath; | |
import org.ojai.FieldSegment; | |
import org.ojai.store.*; | |
import java.util.Arrays; |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.