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
- name: Llama 3.1 Instruct | |
displayName: Llama 3.1 Instruct | |
modelHubID: llama-3.1-instruct | |
category: Text Generation | |
type: HF | |
description: The Llama 3.1 8B-Instruct, 8B instruct and 8B base NIM simplifies the deployment of the Llama 3.1 70B-Instruct, 8B instruct and 8B base tuned models which is optimized for language understanding, reasoning, and text generation use cases, and outperforms many of the available open source chat models on common industry benchmarks. | |
requireLicense: True | |
licenseAgreements: | |
- label: Use Policy | |
url: https://llama.meta.com/llama3/use-policy/ |
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
models: | |
- name: Llama-2-Chat | |
displayName: Llama-2-Chat (Before 24.02) | |
description: Llama-2-Chat model published by Meta | |
versions: | |
- latestVersionId: LLAMA-2-70B-CHAT | |
sha: ff6d1c3ba37b31d4af421951c2300f2256fb3691 | |
latestVersionSizeInBytes: 107224858679 | |
createdDate: 2023-10-24T18:21:04.610Z | |
updatedDate: 2024-04-23T22:57:49.590Z |
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
import logging | |
import logging as log | |
from pathlib import Path | |
from pyspark.sql import DataFrame | |
from pyspark.sql.types import StructType | |
from pyspark.sql.functions import udf | |
from pyspark.sql.types import StructField | |
from pyspark.sql.functions import lit |
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
train_dir = '/home/cdsw/datasettrees' | |
import numpy as np | |
import glob | |
import os | |
import matplotlib.pyplot as plt | |
from PIL import Image | |
train_list = glob.glob(train_dir+'/**/*.jpg',recursive=True) | |
print(train_list) |
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
!pip3 install torch torchvision pandas numpy onnx onnxruntime | |
import argparse | |
import torch | |
import torch.nn.functional as F | |
from torch import nn, optim | |
from torch.optim.lr_scheduler import StepLR | |
from torchvision import datasets, transforms |
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
all permutations of N dice roll | |
def combine(self, n: int, k: int) -> List[List[int]]: | |
combs = [] | |
def backtrack(index, path): | |
if len(path) == k: | |
combs.append(list(path)) | |
return | |
for i in range(index, n+1): |
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
class Solution { | |
public: | |
bool isValidSudoku(vector<vector<char>>& board) { | |
unordered_set<string> seen; | |
for (int i = 0; i < 9; ++i) | |
for (int j = 0; j < 9; ++j) { | |
if (board[i][j] == '.') | |
continue; | |
const string c(1, board[i][j]); |
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
Nearest Neighbour City | |
A number of cities are arranged on a graph that has been divided up like an ordinary Cartesian plane. Each city is located at an integral (x, y) coordinate intersection. City names and locations are given in the form of three arrays: c, x, and y, which are aligned by the index to provide the city name (c[i]), and its coordinates, (x[i], y[i]). Determine the name of the nearest city that shares either an x or a y coordinate with the queried city. If no other cities share an x or y coordinate, return 'NONE'. If two cities have the same distance to the queried city, q[i], consider the one with an alphabetically shorter name (i.e. 'ab' < 'aba' < 'abb') as the closest choice. The distance is the Manhattan distance, the absolute difference in x plus the absolute difference in y. | |
The time complexity for my solution is O(NlogK) for processing input + O(QlogK) for returning the result for all the given queries, | |
where N is the number of cities, K is the max number of cities with same x or y coo |
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
At DoorDash, menus are updated daily even hourly to keep them up-to-date. Each menu can be regarded as a tree. When the merchant sends us the latest menu, can we calculate | |
how many nodes have changed/added/deleted? | |
Assume each Node structure is as below: | |
class Node { | |
String key; | |
int value; | |
List children; | |
} |
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
nput - ("mon 10:00 am", mon 11:00 am) | |
Output - [11005, 11010, 11015...11100] | |
Output starts with 1 if the day is monday, 2 if tuesday and so on till 7 for sunday | |
Append 5 min interval times to that till the end time | |
So here it is 10:05 as first case, so its written as 11005 | |
2nd is 10:10 so its written as 11010 | |
... | |
... | |
Stop at 11100 |
NewerOlder